You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use newest youtube-dl from git repository.
When Crunchyroll site was probably temporarily down, I happened to reproduce AttributeError exception in youtube-dl:
[crunchyroll] 774790: Downloading webpage
[crunchyroll] 774790: Downloading audio-jaJP m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-deDE m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-itIT m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-ptBR m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-esES m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-ruRU m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-frFR m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-esLA m3u8 information
[crunchyroll] 774790: Downloading audio-jaJP-hardsub-enUS m3u8 information
[crunchyroll] 774790: Downloading media info
WARNING: Unable to download XML: HTTP Error 500: Internal Server Error
Traceback (most recent call last):
File "/root/youtube-dl/bin/youtube-dl", line 6, in <module>
youtube_dl.main()
File "/root/youtube-dl/youtube_dl/__init__.py", line 472, in main
_real_main(argv)
File "/root/youtube-dl/youtube_dl/__init__.py", line 462, in _real_main
retcode = ydl.download(all_urls)
File "/root/youtube-dl/youtube_dl/YoutubeDL.py", line 2001, in download
url, force_generic_extractor=self.params.get('force_generic_extractor', False))
File "/root/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
ie_result = ie.extract(url)
File "/root/youtube-dl/youtube_dl/extractor/common.py", line 507, in extract
ie_result = self._real_extract(url)
File "/root/youtube-dl/youtube_dl/extractor/crunchyroll.py", line 601, in _real_extract
season = xpath_text(metadata, 'series_title')
File "/root/youtube-dl/youtube_dl/utils.py", line 313, in xpath_text
n = xpath_element(node, xpath, name, fatal=fatal, default=default)
File "/root/youtube-dl/youtube_dl/utils.py", line 294, in xpath_element
n = _find_xpath(xpath)
File "/root/youtube-dl/youtube_dl/utils.py", line 291, in _find_xpath
return node.find(compat_xpath(xpath))
AttributeError: 'bool' object has no attribute 'find'
By looking at code, it seems that youtube_dl/extractor/common.py:_download_xml() returned False, which it can do (although it is not documented in its doc string):
def _download_xml(
self, url_or_request, video_id,
note='Downloading XML', errnote='Unable to download XML',
transform_source=None, fatal=True, encoding=None,
data=None, headers={}, query={}, expected_status=None):
"""
Return the xml as an xml.etree.ElementTree.Element.
See _download_webpage docstring for arguments specification.
"""
res = self._download_xml_handle(
url_or_request, video_id, note=note, errnote=errnote,
transform_source=transform_source, fatal=fatal, encoding=encoding,
data=data, headers=headers, query=query,
expected_status=expected_status)
return res if res is False else res[0]
^^^^^^^^^^^^^^^^^^^
Next youtube_dl/extractor/crunchyroll.py:_call_rpc_api() returned this False unchanged:
def _call_rpc_api(self, method, video_id, note=None, data=None):
data = data or {}
data['req'] = 'RpcApi' + method
data = compat_urllib_parse_urlencode(data).encode('utf-8')
return self._download_xml(
'https://www.crunchyroll.com/xml/',
video_id, note, fatal=False, data=data, headers={
'Content-Type': 'application/x-www-form-urlencoded',
})
I use newest youtube-dl from git repository.
When Crunchyroll site was probably temporarily down, I happened to reproduce
AttributeError
exception in youtube-dl:By looking at code, it seems that
youtube_dl/extractor/common.py:_download_xml()
returnedFalse
, which it can do (although it is not documented in its doc string):Next
youtube_dl/extractor/crunchyroll.py:_call_rpc_api()
returned thisFalse
unchanged:Which was assigned here:
Functions for XML parsing in
youtube_dl/utils.py
do not work withFalse
, so it is better to return error earlier.Probably something like this:
The text was updated successfully, but these errors were encountered: