Repository: ytdl-org/youtube-dl

Issue:
[prosiebensat1] Unable to download playlist
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.prosieben.de/tv/joko-gegen-klaas/videos/playlists/episode-8-ganze-folge-playlist']
[debug] Encodings: locale UTF-8, fs utf-8, out None, pref UTF-8
[debug] youtube-dl version 2014.12.01
[debug] Python version 2.7.6 - Darwin-14.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.4.4, ffprobe 2.4.4, rtmpdump 2.4
[debug] Proxy map: {}
[prosiebensat1] tv/joko-gegen-klaas/videos/playlists/episode-8-ganze-folge-playlist: Downloading webpage
ERROR: Unable to extract clip id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 553, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 241, in extract
    return self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/prosiebensat1.py", line 186, in _real_extract
    clip_id = self._html_search_regex(self._CLIPID_REGEXES, webpage, 'clip id')
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 491, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 481, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract clip id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.



Discussion:
I guess downloading playlists isn't supported atm?


Resolving patch:
diff --git a/youtube_dl/extractor/prosiebensat1.py b/youtube_dl/extractor/prosiebensat1.py
--- a/youtube_dl/extractor/prosiebensat1.py
+++ b/youtube_dl/extractor/prosiebensat1.py
@@ -8,6 +8,7 @@
 from ..utils import (
     compat_urllib_parse,
     unified_strdate,
+    ExtractorError,
 )
 
 
@@ -85,7 +86,7 @@ class ProSiebenSat1IE(InfoExtractor):
                 'ext': 'mp4',
                 'title': 'Im Interview: Kai Wiesinger',
                 'description': 'md5:e4e5370652ec63b95023e914190b4eb9',
-                'upload_date': '20140225',
+                'upload_date': '20140203',
                 'duration': 522.56,
             },
             'params': {
@@ -100,7 +101,7 @@ class ProSiebenSat1IE(InfoExtractor):
                 'ext': 'mp4',
                 'title': 'Jagd auf Fertigkost im Elsthal - Teil 2',
                 'description': 'md5:2669cde3febe9bce13904f701e774eb6',
-                'upload_date': '20140225',
+                'upload_date': '20141014',
                 'duration': 2410.44,
             },
             'params': {
@@ -152,12 +153,22 @@ class ProSiebenSat1IE(InfoExtractor):
                 'skip_download': True,
             },
         },
+        {
+            'url': 'http://www.prosieben.de/tv/joko-gegen-klaas/videos/playlists/episode-8-ganze-folge-playlist',
+            'info_dict': {
+                'id': '439664',
+                'title': 'Episode 8 - Ganze Folge - Playlist',
+                'description': 'Das finale und härteste Duell aller Zeiten ist vorbei! Der Weltmeister für dieses Jahr steht! Alle packenden Duelle der achten Episode von "Joko gegen Klaas - das Duell um die Welt" seht ihr hier noch einmal in voller Länge!',
+            },
+            'playlist_count': 2,
+        },
     ]
 
     _CLIPID_REGEXES = [
         r'"clip_id"\s*:\s+"(\d+)"',
         r'clipid: "(\d+)"',
         r'clip[iI]d=(\d+)',
+        r"'itemImageUrl'\s*:\s*'/dynamic/thumbnails/full/\d+/(\d+)",
     ]
     _TITLE_REGEXES = [
         r'<h2 class="subtitle" itemprop="name">\s*(.+?)</h2>',
@@ -178,11 +189,48 @@ class ProSiebenSat1IE(InfoExtractor):
         r'<span style="padding-left: 4px;line-height:20px; color:#404040">(\d{2}\.\d{2}\.\d{4})</span>',
         r'(\d{2}\.\d{2}\.\d{4}) \| \d{2}:\d{2} Min<br/>',
     ]
+    _ITEM_TYPE_REGEXES = [
+        r"'itemType'\s*:\s*'([^']*)'",
+    ]
+    _ITEM_ID_REGEXES = [
+        r"'itemId'\s*:\s*'([^']*)'",
+    ]
+    _PLAYLIST_CLIPS_REGEXES = [
+        r'data-qvt=.+?<a href="([^"]+)"',
+    ]
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
+        item_type = self._html_search_regex(self._ITEM_TYPE_REGEXES, webpage, 'item type', default='CLIP')
+        if item_type == 'CLIP':
+            return self._clip_extract(url, webpage)
+        elif item_type == 'PLAYLIST':
+            playlist_id = self._html_search_regex(self._ITEM_ID_REGEXES, webpage, 'playlist id')
+
+            for regex in self._PLAYLIST_CLIPS_REGEXES:
+                playlist_clips = re.findall(regex, webpage, re.DOTALL)
+                if playlist_clips:
+                    title = self._html_search_regex(self._TITLE_REGEXES, webpage, 'title')
+                    description = self._html_search_regex(self._DESCRIPTION_REGEXES, webpage, 'description', fatal=False)
+                    root_url = re.match('(.+?//.+?)/', url).group(1)
+
+                    return {
+                        '_type': 'playlist',
+                        'id': playlist_id,
+                        'title': title,
+                        'description': description,
+                        'entries': [self._clip_extract(root_url + clip_path) for clip_path in playlist_clips]
+                    }
+        else:
+            raise ExtractorError('Unknown item type "%s"' % item_type)
+
+    def _clip_extract(self, url, webpage=None):
+        if webpage is None:
+            video_id = self._match_id(url)
+            webpage = self._download_webpage(url, video_id)
+
         clip_id = self._html_search_regex(self._CLIPID_REGEXES, webpage, 'clip id')
 
         access_token = 'testclient'


Test patch: