mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-21 08:55:19 +00:00
[cleanup] Add more ruff rules (#10149)
Authored by: seproDev Reviewed-by: bashonly <88596187+bashonly@users.noreply.github.com> Reviewed-by: Simon Sawicki <contact@grub4k.xyz>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import re
|
||||
import urllib.parse
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..aes import aes_decrypt_text
|
||||
from ..compat import compat_urllib_parse_unquote
|
||||
from ..utils import (
|
||||
determine_ext,
|
||||
format_field,
|
||||
@@ -100,12 +100,12 @@ class Tube8IE(InfoExtractor):
|
||||
r'flashvars\.video_url\s*=\s*(["\'])(?P<url>http.+?)\1',
|
||||
webpage, 'video url', default=None, group='url')
|
||||
if video_url:
|
||||
extract_format(compat_urllib_parse_unquote(video_url))
|
||||
extract_format(urllib.parse.unquote(video_url))
|
||||
|
||||
if not formats:
|
||||
if 'title="This video is no longer available"' in webpage:
|
||||
self.raise_no_formats(
|
||||
'Video %s is no longer available' % video_id, expected=True)
|
||||
f'Video {video_id} is no longer available', expected=True)
|
||||
|
||||
if not title:
|
||||
title = self._html_search_regex(
|
||||
@@ -153,8 +153,8 @@ class Tube8IE(InfoExtractor):
|
||||
tags_str = self._search_regex(
|
||||
r'(?s)Tags:\s*</dt>\s*<dd>(.+?)</(?!a)',
|
||||
webpage, 'tags', fatal=False)
|
||||
tags = [t for t in re.findall(
|
||||
r'<a[^>]+href=[^>]+>([^<]+)', tags_str)] if tags_str else None
|
||||
tags = list(re.findall(
|
||||
r'<a[^>]+href=[^>]+>([^<]+)', tags_str)) if tags_str else None
|
||||
|
||||
info.update({
|
||||
'description': description,
|
||||
|
||||
Reference in New Issue
Block a user