This commit is contained in:
pukkandan 2024-04-01 20:17:23 +05:30
parent 93e83fa261
commit c414c3d406
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39
7 changed files with 13 additions and 13 deletions

View File

@ -15,7 +15,7 @@ from devscripts.utils import get_filename_args, read_file, write_file
NO_ATTR = object() NO_ATTR = object()
STATIC_CLASS_PROPERTIES = [ STATIC_CLASS_PROPERTIES = [
'IE_NAME', '_ENABLED', '_VALID_URL', # Used for URL matching 'IE_NAME', '_ENABLED', '_VALID_URL', # Used for URL matching
'_BROKEN_ISSUE', 'IE_DESC', '_NETRC_MACHINE', 'SEARCH_KEY', # Used for --extractor-descriptions '_REPORTED_BROKEN', 'IE_DESC', '_NETRC_MACHINE', 'SEARCH_KEY', # Used for --extractor-descriptions
'age_limit', # Used for --age-limit (evaluated) 'age_limit', # Used for --age-limit (evaluated)
'_RETURN_TYPE', # Accessed in CLI only with instance (evaluated) '_RETURN_TYPE', # Accessed in CLI only with instance (evaluated)
] ]

View File

@ -98,7 +98,7 @@ def generator(test_case, tname):
self.skipTest(reason) self.skipTest(reason)
if not ie.working(): if not ie.working():
print_skipping('IE marked with _BROKEN_ISSUE') print_skipping('IE is _REPORTED_BROKEN')
for tc in test_cases: for tc in test_cases:
if tc.get('expected_exception'): if tc.get('expected_exception'):
@ -117,7 +117,7 @@ def generator(test_case, tname):
for other_ie in other_ies: for other_ie in other_ies:
if not other_ie.working(): if not other_ie.working():
print_skipping('test depends on %sIE, marked with _BROKEN_ISSUE' % other_ie.ie_key()) print_skipping('test depends on %sIE, is _REPORTED_BROKEN' % other_ie.ie_key())
params = get_params(test_case.get('params', {})) params = get_params(test_case.get('params', {}))
params['outtmpl'] = tname + '_' + params['outtmpl'] params['outtmpl'] = tname + '_' + params['outtmpl']

View File

@ -40,8 +40,8 @@ class BaseTestSubtitles(unittest.TestCase):
self.ie = self.IE() self.ie = self.IE()
self.DL.add_info_extractor(self.ie) self.DL.add_info_extractor(self.ie)
if not self.IE.working(): if not self.IE.working():
print('Skipping: %s marked with _BROKEN_ISSUE' % self.IE.ie_key()) print('Skipping: %s is _REPORTED_BROKEN' % self.IE.ie_key())
self.skipTest('IE marked with _BROKEN_ISSUE') self.skipTest('IE is _REPORTED_BROKEN')
def getInfoDict(self): def getInfoDict(self):
info_dict = self.DL.extract_info(self.url, download=False) info_dict = self.DL.extract_info(self.url, download=False)

View File

@ -1573,7 +1573,7 @@ class YoutubeDL:
self.report_warning(join_nonempty( self.report_warning(join_nonempty(
f'[{ie.IE_NAME}] The program\'s functionality for this site has been marked as ' f'[{ie.IE_NAME}] The program\'s functionality for this site has been marked as '
f'{self._format_err("BROKEN", self.Styles.ERROR)}, and will probably not work.', f'{self._format_err("BROKEN", self.Styles.ERROR)}, and will probably not work.',
format_field(ie._BROKEN_ISSUE, None, f'See {self._format_err("%s", self.Styles.EMPHASIS)}' format_field(ie._REPORTED_BROKEN, None, f'See {self._format_err("%s", self.Styles.EMPHASIS)}'
' for more information. Do NOT open a new issue for this.'), ' for more information. Do NOT open a new issue for this.'),
delim='\n ')) delim='\n '))

View File

@ -544,7 +544,7 @@ class InfoExtractor:
The _ENABLED attribute should be set to False for IEs that The _ENABLED attribute should be set to False for IEs that
are disabled by default and must be explicitly enabled. are disabled by default and must be explicitly enabled.
For broken extractors, the _BROKEN_ISSUE attribute can be set to the issue URL For broken extractors, the _REPORTED_BROKEN attribute can be set to the issue URL
in order to warn the users and skip the tests. in order to warn the users and skip the tests.
[Deprecated] If there is no open issue, set _WORKING = False instead. [Deprecated] If there is no open issue, set _WORKING = False instead.
""" """
@ -613,12 +613,12 @@ class InfoExtractor:
return None return None
@classproperty(cache=True) @classproperty(cache=True)
def _BROKEN_ISSUE(cls): def _REPORTED_BROKEN(cls):
return not cls._WORKING and '' return not cls._WORKING and ''
@classmethod @classmethod
def working(cls): def working(cls):
return cls._BROKEN_ISSUE is False return cls._REPORTED_BROKEN is False
@classmethod @classmethod
def supports_login(cls): def supports_login(cls):
@ -3636,8 +3636,8 @@ class InfoExtractor:
msg = 'Currently broken' msg = 'Currently broken'
if markdown: if markdown:
msg = f'**{msg}**' msg = f'**{msg}**'
if cls._BROKEN_ISSUE: if cls._REPORTED_BROKEN:
msg = f'[{msg}]({cls._BROKEN_ISSUE})' msg = f'[{msg}]({cls._REPORTED_BROKEN})'
desc += f' ({msg})' desc += f' ({msg})'
# Escape emojis. Ref: https://github.com/github/markup/issues/1153 # Escape emojis. Ref: https://github.com/github/markup/issues/1153

View File

@ -21,7 +21,7 @@ from ..utils import (
class CrunchyrollBaseIE(InfoExtractor): class CrunchyrollBaseIE(InfoExtractor):
_BROKEN_ISSUE = 'https://github.com/yt-dlp/yt-dlp/issues/9453' _REPORTED_BROKEN = 'https://github.com/yt-dlp/yt-dlp/issues/9453'
_BASE_URL = 'https://www.crunchyroll.com' _BASE_URL = 'https://www.crunchyroll.com'
_API_BASE = 'https://api.crunchyroll.com' _API_BASE = 'https://api.crunchyroll.com'
_NETRC_MACHINE = 'crunchyroll' _NETRC_MACHINE = 'crunchyroll'

View File

@ -9,7 +9,7 @@ from ..utils import (
class HiDiveIE(InfoExtractor): class HiDiveIE(InfoExtractor):
_BROKEN_ISSUE = 'https://github.com/yt-dlp/yt-dlp/issues/9385' _REPORTED_BROKEN = 'https://github.com/yt-dlp/yt-dlp/issues/9385'
_VALID_URL = r'https?://(?:www\.)?hidive\.com/stream/(?P<id>(?P<title>[^/]+)/(?P<key>[^/?#&]+))' _VALID_URL = r'https?://(?:www\.)?hidive\.com/stream/(?P<id>(?P<title>[^/]+)/(?P<key>[^/?#&]+))'
# Using X-Forwarded-For results in 403 HTTP error for HLS fragments, # Using X-Forwarded-For results in 403 HTTP error for HLS fragments,
# so disabling geo bypass completely # so disabling geo bypass completely