We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
AttributeError in ard module
With the command given below, I get the error message below. I'm using version 2014.06.09.

`youtube-dl http://www.ardmediathek.de/tv/Klassiker-der-Weltliteratur/Max-Frisch/BR-alpha/Video\?documentId\=19067308\&bcastId\=14913194`

```
[ARD] 19067308: Downloading webpage
[ARD] 19067308: Downloading JSON metadata
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 9, in <module>
    load_entry_point('youtube-dl==2014.06.09', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 853, in main
    _real_main(argv)
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 843, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1050, in download
    self.extract_info(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 516, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/common.py", line 168, in extract
    return self._real_extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/ard.py", line 66, in _real_extract
    determine_ext(format['url']), format['quality'])
  File "/usr/lib/python3.4/site-packages/youtube_dl/utils.py", line 845, in determine_ext
    guess = url.partition(u'?')[0].rpartition(u'.')[2]
AttributeError: 'list' object has no attribute 'partition'
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `youtube_dl/extractor/ard.py`
Content:
```
1 # coding: utf-8
2 from __future__ import unicode_literals
3 
4 import re
5 
6 from .common import InfoExtractor
7 from ..utils import (
8     determine_ext,
9     ExtractorError,
10 )
11 
12 
13 class ARDIE(InfoExtractor):
14     _VALID_URL = r'^https?://(?:(?:www\.)?ardmediathek\.de|mediathek\.daserste\.de)/(?:.*/)(?P<video_id>[^/\?]+)(?:\?.*)?'
15 
16     _TEST = {
17         'url': 'http://www.ardmediathek.de/das-erste/guenther-jauch/edward-snowden-im-interview-held-oder-verraeter?documentId=19288786',
18         'file': '19288786.mp4',
19         'md5': '515bf47ce209fb3f5a61b7aad364634c',
20         'info_dict': {
21             'title': 'Edward Snowden im Interview - Held oder Verräter?',
22             'description': 'Edward Snowden hat alles aufs Spiel gesetzt, um die weltweite \xdcberwachung durch die Geheimdienste zu enttarnen. Nun stellt sich der ehemalige NSA-Mitarbeiter erstmals weltweit in einem TV-Interview den Fragen eines NDR-Journalisten. Die Sendung vom Sonntagabend.',
23             'thumbnail': 'http://www.ardmediathek.de/ard/servlet/contentblob/19/28/87/90/19288790/bild/2250037',
24         },
25         'skip': 'Blocked outside of Germany',
26     }
27 
28     def _real_extract(self, url):
29         # determine video id from url
30         m = re.match(self._VALID_URL, url)
31 
32         numid = re.search(r'documentId=([0-9]+)', url)
33         if numid:
34             video_id = numid.group(1)
35         else:
36             video_id = m.group('video_id')
37 
38         webpage = self._download_webpage(url, video_id)
39 
40         title = self._html_search_regex(
41             [r'<h1(?:\s+class="boxTopHeadline")?>(.*?)</h1>',
42              r'<meta name="dcterms.title" content="(.*?)"/>',
43              r'<h4 class="headline">(.*?)</h4>'],
44             webpage, 'title')
45         description = self._html_search_meta(
46             'dcterms.abstract', webpage, 'description')
47         thumbnail = self._og_search_thumbnail(webpage)
48 
49 
50         media_info = self._download_json(
51             'http://www.ardmediathek.de/play/media/%s' % video_id, video_id)
52         # The second element of the _mediaArray contains the standard http urls
53         streams = media_info['_mediaArray'][1]['_mediaStreamArray']
54         if not streams:
55             if '"fsk"' in webpage:
56                 raise ExtractorError('This video is only available after 20:00')
57 
58         formats = []
59         for s in streams:
60             format = {
61                 'quality': s['_quality'],
62                 'url': s['_stream'],
63             }
64 
65             format['format_id'] = '%s-%s' % (
66                 determine_ext(format['url']), format['quality'])
67 
68             formats.append(format)
69 
70         self._sort_formats(formats)
71 
72         return {
73             'id': video_id,
74             'title': title,
75             'description': description,
76             'formats': formats,
77             'thumbnail': thumbnail,
78         }
79
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/youtube_dl/extractor/ard.py b/youtube_dl/extractor/ard.py
--- a/youtube_dl/extractor/ard.py
+++ b/youtube_dl/extractor/ard.py
@@ -56,7 +56,18 @@
                 raise ExtractorError('This video is only available after 20:00')
 
         formats = []
+
         for s in streams:
+            if type(s['_stream']) == list:
+                for index, url in enumerate(s['_stream'][::-1]):
+                    quality = s['_quality'] + index
+                    formats.append({
+                        'quality': quality,
+                        'url': url,
+                        'format_id': '%s-%s' % (determine_ext(url), quality)
+                        })
+                continue
+
             format = {
                 'quality': s['_quality'],
                 'url': s['_stream'],

{"golden_diff": "diff --git a/youtube_dl/extractor/ard.py b/youtube_dl/extractor/ard.py\n--- a/youtube_dl/extractor/ard.py\n+++ b/youtube_dl/extractor/ard.py\n@@ -56,7 +56,18 @@\n                 raise ExtractorError('This video is only available after 20:00')\n \n         formats = []\n+\n         for s in streams:\n+            if type(s['_stream']) == list:\n+                for index, url in enumerate(s['_stream'][::-1]):\n+                    quality = s['_quality'] + index\n+                    formats.append({\n+                        'quality': quality,\n+                        'url': url,\n+                        'format_id': '%s-%s' % (determine_ext(url), quality)\n+                        })\n+                continue\n+\n             format = {\n                 'quality': s['_quality'],\n                 'url': s['_stream'],\n", "issue": "AttributeError in ard module\nWith the command given below, I get the error message below. I'm using version 2014.06.09.\n\n`youtube-dl http://www.ardmediathek.de/tv/Klassiker-der-Weltliteratur/Max-Frisch/BR-alpha/Video\\?documentId\\=19067308\\&bcastId\\=14913194`\n\n```\n[ARD] 19067308: Downloading webpage\n[ARD] 19067308: Downloading JSON metadata\nTraceback (most recent call last):\n  File \"/usr/bin/youtube-dl\", line 9, in <module>\n    load_entry_point('youtube-dl==2014.06.09', 'console_scripts', 'youtube-dl')()\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/__init__.py\", line 853, in main\n    _real_main(argv)\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/__init__.py\", line 843, in _real_main\n    retcode = ydl.download(all_urls)\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py\", line 1050, in download\n    self.extract_info(url)\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py\", line 516, in extract_info\n    ie_result = ie.extract(url)\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/extractor/common.py\", line 168, in extract\n    return self._real_extract(url)\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/extractor/ard.py\", line 66, in _real_extract\n    determine_ext(format['url']), format['quality'])\n  File \"/usr/lib/python3.4/site-packages/youtube_dl/utils.py\", line 845, in determine_ext\n    guess = url.partition(u'?')[0].rpartition(u'.')[2]\nAttributeError: 'list' object has no attribute 'partition'\n```\n\n", "before_files": [{"content": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom ..utils import (\n    determine_ext,\n    ExtractorError,\n)\n\n\nclass ARDIE(InfoExtractor):\n    _VALID_URL = r'^https?://(?:(?:www\\.)?ardmediathek\\.de|mediathek\\.daserste\\.de)/(?:.*/)(?P<video_id>[^/\\?]+)(?:\\?.*)?'\n\n    _TEST = {\n        'url': 'http://www.ardmediathek.de/das-erste/guenther-jauch/edward-snowden-im-interview-held-oder-verraeter?documentId=19288786',\n        'file': '19288786.mp4',\n        'md5': '515bf47ce209fb3f5a61b7aad364634c',\n        'info_dict': {\n            'title': 'Edward Snowden im Interview - Held oder Verr\u00e4ter?',\n            'description': 'Edward Snowden hat alles aufs Spiel gesetzt, um die weltweite \\xdcberwachung durch die Geheimdienste zu enttarnen. Nun stellt sich der ehemalige NSA-Mitarbeiter erstmals weltweit in einem TV-Interview den Fragen eines NDR-Journalisten. Die Sendung vom Sonntagabend.',\n            'thumbnail': 'http://www.ardmediathek.de/ard/servlet/contentblob/19/28/87/90/19288790/bild/2250037',\n        },\n        'skip': 'Blocked outside of Germany',\n    }\n\n    def _real_extract(self, url):\n        # determine video id from url\n        m = re.match(self._VALID_URL, url)\n\n        numid = re.search(r'documentId=([0-9]+)', url)\n        if numid:\n            video_id = numid.group(1)\n        else:\n            video_id = m.group('video_id')\n\n        webpage = self._download_webpage(url, video_id)\n\n        title = self._html_search_regex(\n            [r'<h1(?:\\s+class=\"boxTopHeadline\")?>(.*?)</h1>',\n             r'<meta name=\"dcterms.title\" content=\"(.*?)\"/>',\n             r'<h4 class=\"headline\">(.*?)</h4>'],\n            webpage, 'title')\n        description = self._html_search_meta(\n            'dcterms.abstract', webpage, 'description')\n        thumbnail = self._og_search_thumbnail(webpage)\n\n\n        media_info = self._download_json(\n            'http://www.ardmediathek.de/play/media/%s' % video_id, video_id)\n        # The second element of the _mediaArray contains the standard http urls\n        streams = media_info['_mediaArray'][1]['_mediaStreamArray']\n        if not streams:\n            if '\"fsk\"' in webpage:\n                raise ExtractorError('This video is only available after 20:00')\n\n        formats = []\n        for s in streams:\n            format = {\n                'quality': s['_quality'],\n                'url': s['_stream'],\n            }\n\n            format['format_id'] = '%s-%s' % (\n                determine_ext(format['url']), format['quality'])\n\n            formats.append(format)\n\n        self._sort_formats(formats)\n\n        return {\n            'id': video_id,\n            'title': title,\n            'description': description,\n            'formats': formats,\n            'thumbnail': thumbnail,\n        }\n", "path": "youtube_dl/extractor/ard.py"}], "after_files": [{"content": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom ..utils import (\n    determine_ext,\n    ExtractorError,\n)\n\n\nclass ARDIE(InfoExtractor):\n    _VALID_URL = r'^https?://(?:(?:www\\.)?ardmediathek\\.de|mediathek\\.daserste\\.de)/(?:.*/)(?P<video_id>[^/\\?]+)(?:\\?.*)?'\n\n    _TEST = {\n        'url': 'http://www.ardmediathek.de/das-erste/guenther-jauch/edward-snowden-im-interview-held-oder-verraeter?documentId=19288786',\n        'file': '19288786.mp4',\n        'md5': '515bf47ce209fb3f5a61b7aad364634c',\n        'info_dict': {\n            'title': 'Edward Snowden im Interview - Held oder Verr\u00e4ter?',\n            'description': 'Edward Snowden hat alles aufs Spiel gesetzt, um die weltweite \\xdcberwachung durch die Geheimdienste zu enttarnen. Nun stellt sich der ehemalige NSA-Mitarbeiter erstmals weltweit in einem TV-Interview den Fragen eines NDR-Journalisten. Die Sendung vom Sonntagabend.',\n            'thumbnail': 'http://www.ardmediathek.de/ard/servlet/contentblob/19/28/87/90/19288790/bild/2250037',\n        },\n        'skip': 'Blocked outside of Germany',\n    }\n\n    def _real_extract(self, url):\n        # determine video id from url\n        m = re.match(self._VALID_URL, url)\n\n        numid = re.search(r'documentId=([0-9]+)', url)\n        if numid:\n            video_id = numid.group(1)\n        else:\n            video_id = m.group('video_id')\n\n        webpage = self._download_webpage(url, video_id)\n\n        title = self._html_search_regex(\n            [r'<h1(?:\\s+class=\"boxTopHeadline\")?>(.*?)</h1>',\n             r'<meta name=\"dcterms.title\" content=\"(.*?)\"/>',\n             r'<h4 class=\"headline\">(.*?)</h4>'],\n            webpage, 'title')\n        description = self._html_search_meta(\n            'dcterms.abstract', webpage, 'description')\n        thumbnail = self._og_search_thumbnail(webpage)\n\n\n        media_info = self._download_json(\n            'http://www.ardmediathek.de/play/media/%s' % video_id, video_id)\n        # The second element of the _mediaArray contains the standard http urls\n        streams = media_info['_mediaArray'][1]['_mediaStreamArray']\n        if not streams:\n            if '\"fsk\"' in webpage:\n                raise ExtractorError('This video is only available after 20:00')\n\n        formats = []\n\n        for s in streams:\n            if type(s['_stream']) == list:\n                for index, url in enumerate(s['_stream'][::-1]):\n                    quality = s['_quality'] + index\n                    formats.append({\n                        'quality': quality,\n                        'url': url,\n                        'format_id': '%s-%s' % (determine_ext(url), quality)\n                        })\n                continue\n\n            format = {\n                'quality': s['_quality'],\n                'url': s['_stream'],\n            }\n\n            format['format_id'] = '%s-%s' % (\n                determine_ext(format['url']), format['quality'])\n\n            formats.append(format)\n\n        self._sort_formats(formats)\n\n        return {\n            'id': video_id,\n            'title': title,\n            'description': description,\n            'formats': formats,\n            'thumbnail': thumbnail,\n        }\n", "path": "youtube_dl/extractor/ard.py"}]}