[youtube] Fix category extraction
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 31 Aug 2014 21:26:19 +0000 (23:26 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 31 Aug 2014 21:26:19 +0000 (23:26 +0200)
youtube_dl/extractor/youtube.py

index bdabcaa27b8d4ad85532f7bd2d34e87026b8a0b0..3417c1275a972d6cfaf98b74e72bf60bbc6f33f4 100644 (file)
@@ -786,7 +786,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
             upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split())
             upload_date = unified_strdate(upload_date)
 
-        m_cat_container = get_element_by_id("eow-category", video_webpage)
+        m_cat_container = self._search_regex(
+            r'(?s)<h4[^>]*>\s*Category\s*</h4>\s*<ul[^>]*>(.*?)</ul>',
+            video_webpage, 'categories', fatal=False)
         if m_cat_container:
             category = self._html_search_regex(
                 r'(?s)<a[^<]+>(.*?)</a>', m_cat_container, 'category',