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
..
2013-10-28 11:28:02 +01:00
2013-07-03 16:36:36 +02:00
2013-06-27 20:46:46 +02:00
2013-07-23 11:41:05 +02:00
2013-08-27 01:00:17 +05:00
2013-08-28 10:20:37 +02:00
2013-07-17 14:39:02 +02:00
2013-09-03 12:03:19 +02:00
2013-09-14 14:45:04 +02:00
2013-11-02 20:51:09 +01:00
2013-10-04 07:47:40 +02:00
2013-07-15 21:33:45 +02:00
2013-07-25 09:52:58 +02:00
2013-06-27 20:32:02 +02:00
2013-06-25 22:04:44 +02:00
2013-06-27 20:46:46 +02:00
2013-09-06 18:08:07 +02:00
2013-08-28 14:24:42 -05:00
2013-06-27 20:46:46 +02:00
2013-09-18 22:14:43 +02:00
2013-10-23 17:00:33 +02:00
2013-06-27 20:46:46 +02:00
2013-06-28 18:51:00 +02:00
2013-08-24 21:10:03 +02:00
2013-06-27 20:46:46 +02:00
2013-08-21 19:20:27 +02:00
2013-10-15 08:22:59 +02:00
2013-10-04 10:32:34 +02:00
2013-07-17 11:18:14 +02:00
2013-09-14 14:45:04 +02:00
2013-10-18 11:16:20 +02:00
2013-06-30 13:52:20 +02:00
2013-06-27 20:46:46 +02:00
2013-07-09 11:11:55 +02:00
2013-08-28 12:47:38 +02:00
2013-10-15 08:12:30 +02:00
2013-06-27 20:46:46 +02:00
2013-10-18 23:35:17 +02:00