0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-01 23:12:40 +00:00
yt-dlp/youtube_dl
Marcin Cieślak a8eeb0597b Fix AssertionError when og property not found
On tvp.pl some webpages contain OpenGraph
metadata and some don't.

If og property is not found, _og_search_description
fails with

WARNING: unable to extract OpenGraph description; please report this issue on http://yt-dl.org/bug
Traceback (most recent call last):
  File "/usr/home/saper/bin/youtube-dl", line 18, in <module>
    youtube_dl.main()
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/__init__.py", line 766, in main
    _real_main(argv)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/__init__.py", line 719, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/YoutubeDL.py", line 715, in download
    videos = self.extract_info(url)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/YoutubeDL.py", line 348, in extract_info
    ie_result = ie.extract(url)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/extractor/common.py", line 125, in extract
    return self._real_extract(url)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/extractor/tvp.py", line 56, in _real_extract
    info['description'] = self._og_search_description(webpage)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/extractor/common.py", line 331, in _og_search_description
    return self._og_search_property('description', html, fatal=False, **kargs)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/extractor/common.py", line 325, in _og_search_property
    return unescapeHTML(escaped)
  File "/usr/home/saper/sw/youtube-dl/youtube_dl/utils.py", line 494, in unescapeHTML
    assert type(s) == type(u'')
AssertionError

The patch allows me to use:

  try:
    info['description'] = self._og_search_description(webpage)
    info['thumbnail'] = self._og_search_thumbnail(webpage)
  except RegexNotFoundError:
    pass
2013-11-05 23:19:29 +01:00
..
extractor Fix AssertionError when og property not found 2013-11-05 23:19:29 +01:00
__init__.py New debug option --write-pages 2013-10-28 10:44:02 +01:00
__main__.py Resolve the symlink if __main__.py is invoke as a symlink. 2013-04-11 08:02:17 +03:00
aes.py Let aes_decrypt_text return bytes instead of unicode 2013-08-28 16:03:35 +02:00
FileDownloader.py Make sure it only runs rtmpdump one time in test mode and return True if the download can be resumed 2013-10-11 12:42:15 +02:00
InfoExtractors.py Remove mentions of old InfoExtractors module 2013-06-23 22:42:59 +02:00
PostProcessor.py Do not import * 2013-10-15 02:07:26 +02:00
update.py [update] Prevent cmd window popup on Windows (Fixes #1478) 2013-09-29 14:37:06 +02:00
utils.py [vimeo] Fix pro videos and player.vimeo.com urls 2013-10-23 14:38:03 +02:00
version.py release 2013.11.03 2013-11-03 15:50:36 +01:00
YoutubeDL.py Set the 'extractor_key' field in the info_dict 2013-11-03 12:14:44 +01:00