We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Unable to download videos from http://channel.nationalgeographic.com.
Example:

$ youtube-dl -v "http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.26.1
[debug] Python version 3.4.2 (CPython) - Linux-3.16.0-5-amd64-x86_64-with-debian-8.10
[debug] exe versions: ffmpeg 3.2.10-1, ffprobe 3.2.10-1, rtmpdump 2.4
[debug] Proxy map: {}
[generic] kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg: Requesting header
WARNING: Falling back on generic information extractor.
[generic] kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg: Downloading webpage
[generic] kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg: Extracting information
ERROR: Unsupported URL: http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/
Traceback (most recent call last):
  File "/home/ant/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 785, in extract_info
    ie_result = ie.extract(url)
  File "/home/ant/bin/youtube-dl/youtube_dl/extractor/common.py", line 440, in extract
    ie_result = self._real_extract(url)
  File "/home/ant/bin/youtube-dl/youtube_dl/extractor/generic.py", line 3143, in _real_extract
    raise UnsupportedError(url)
youtube_dl.utils.UnsupportedError: Unsupported URL: http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/

Thank you in advance. :)

--- 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/nationalgeographic.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 import re
4 
5 from .common import InfoExtractor
6 from .adobepass import AdobePassIE
7 from .theplatform import ThePlatformIE
8 from ..utils import (
9     smuggle_url,
10     url_basename,
11     update_url_query,
12     get_element_by_class,
13 )
14 
15 
16 class NationalGeographicVideoIE(InfoExtractor):
17     IE_NAME = 'natgeo:video'
18     _VALID_URL = r'https?://video\.nationalgeographic\.com/.*?'
19 
20     _TESTS = [
21         {
22             'url': 'http://video.nationalgeographic.com/video/news/150210-news-crab-mating-vin?source=featuredvideo',
23             'md5': '730855d559abbad6b42c2be1fa584917',
24             'info_dict': {
25                 'id': '0000014b-70a1-dd8c-af7f-f7b559330001',
26                 'ext': 'mp4',
27                 'title': 'Mating Crabs Busted by Sharks',
28                 'description': 'md5:16f25aeffdeba55aaa8ec37e093ad8b3',
29                 'timestamp': 1423523799,
30                 'upload_date': '20150209',
31                 'uploader': 'NAGS',
32             },
33             'add_ie': ['ThePlatform'],
34         },
35         {
36             'url': 'http://video.nationalgeographic.com/wild/when-sharks-attack/the-real-jaws',
37             'md5': '6a3105eb448c070503b3105fb9b320b5',
38             'info_dict': {
39                 'id': 'ngc-I0IauNSWznb_UV008GxSbwY35BZvgi2e',
40                 'ext': 'mp4',
41                 'title': 'The Real Jaws',
42                 'description': 'md5:8d3e09d9d53a85cd397b4b21b2c77be6',
43                 'timestamp': 1433772632,
44                 'upload_date': '20150608',
45                 'uploader': 'NAGS',
46             },
47             'add_ie': ['ThePlatform'],
48         },
49     ]
50 
51     def _real_extract(self, url):
52         name = url_basename(url)
53 
54         webpage = self._download_webpage(url, name)
55         guid = self._search_regex(
56             r'id="(?:videoPlayer|player-container)"[^>]+data-guid="([^"]+)"',
57             webpage, 'guid')
58 
59         return {
60             '_type': 'url_transparent',
61             'ie_key': 'ThePlatform',
62             'url': smuggle_url(
63                 'http://link.theplatform.com/s/ngs/media/guid/2423130747/%s?mbr=true' % guid,
64                 {'force_smil_url': True}),
65             'id': guid,
66         }
67 
68 
69 class NationalGeographicIE(ThePlatformIE, AdobePassIE):
70     IE_NAME = 'natgeo'
71     _VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:(?:wild/)?[^/]+/)?(?:videos|episodes)/(?P<id>[^/?]+)'
72 
73     _TESTS = [
74         {
75             'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',
76             'md5': '518c9aa655686cf81493af5cc21e2a04',
77             'info_dict': {
78                 'id': 'vKInpacll2pC',
79                 'ext': 'mp4',
80                 'title': 'Uncovering a Universal Knowledge',
81                 'description': 'md5:1a89148475bf931b3661fcd6ddb2ae3a',
82                 'timestamp': 1458680907,
83                 'upload_date': '20160322',
84                 'uploader': 'NEWA-FNG-NGTV',
85             },
86             'add_ie': ['ThePlatform'],
87         },
88         {
89             'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',
90             'md5': 'c4912f656b4cbe58f3e000c489360989',
91             'info_dict': {
92                 'id': 'Pok5lWCkiEFA',
93                 'ext': 'mp4',
94                 'title': 'The Stunning Red Bird of Paradise',
95                 'description': 'md5:7bc8cd1da29686be4d17ad1230f0140c',
96                 'timestamp': 1459362152,
97                 'upload_date': '20160330',
98                 'uploader': 'NEWA-FNG-NGTV',
99             },
100             'add_ie': ['ThePlatform'],
101         },
102         {
103             'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/episodes/the-power-of-miracles/',
104             'only_matching': True,
105         },
106         {
107             'url': 'http://channel.nationalgeographic.com/videos/treasures-rediscovered/',
108             'only_matching': True,
109         }
110     ]
111 
112     def _real_extract(self, url):
113         display_id = self._match_id(url)
114         webpage = self._download_webpage(url, display_id)
115         release_url = self._search_regex(
116             r'video_auth_playlist_url\s*=\s*"([^"]+)"',
117             webpage, 'release url')
118         theplatform_path = self._search_regex(r'https?://link\.theplatform\.com/s/([^?]+)', release_url, 'theplatform path')
119         video_id = theplatform_path.split('/')[-1]
120         query = {
121             'mbr': 'true',
122         }
123         is_auth = self._search_regex(r'video_is_auth\s*=\s*"([^"]+)"', webpage, 'is auth', fatal=False)
124         if is_auth == 'auth':
125             auth_resource_id = self._search_regex(
126                 r"video_auth_resourceId\s*=\s*'([^']+)'",
127                 webpage, 'auth resource id')
128             query['auth'] = self._extract_mvpd_auth(url, video_id, 'natgeo', auth_resource_id)
129 
130         formats = []
131         subtitles = {}
132         for key, value in (('switch', 'http'), ('manifest', 'm3u')):
133             tp_query = query.copy()
134             tp_query.update({
135                 key: value,
136             })
137             tp_formats, tp_subtitles = self._extract_theplatform_smil(
138                 update_url_query(release_url, tp_query), video_id, 'Downloading %s SMIL data' % value)
139             formats.extend(tp_formats)
140             subtitles = self._merge_subtitles(subtitles, tp_subtitles)
141         self._sort_formats(formats)
142 
143         info = self._extract_theplatform_metadata(theplatform_path, display_id)
144         info.update({
145             'id': video_id,
146             'formats': formats,
147             'subtitles': subtitles,
148             'display_id': display_id,
149         })
150         return info
151 
152 
153 class NationalGeographicEpisodeGuideIE(InfoExtractor):
154     IE_NAME = 'natgeo:episodeguide'
155     _VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:wild/)?(?P<id>[^/]+)/episode-guide'
156     _TESTS = [
157         {
158             'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/episode-guide/',
159             'info_dict': {
160                 'id': 'the-story-of-god-with-morgan-freeman-season-1',
161                 'title': 'The Story of God with Morgan Freeman - Season 1',
162             },
163             'playlist_mincount': 6,
164         },
165         {
166             'url': 'http://channel.nationalgeographic.com/underworld-inc/episode-guide/?s=2',
167             'info_dict': {
168                 'id': 'underworld-inc-season-2',
169                 'title': 'Underworld, Inc. - Season 2',
170             },
171             'playlist_mincount': 7,
172         },
173     ]
174 
175     def _real_extract(self, url):
176         display_id = self._match_id(url)
177         webpage = self._download_webpage(url, display_id)
178         show = get_element_by_class('show', webpage)
179         selected_season = self._search_regex(
180             r'<div[^>]+class="select-seasons[^"]*".*?<a[^>]*>(.*?)</a>',
181             webpage, 'selected season')
182         entries = [
183             self.url_result(self._proto_relative_url(entry_url), 'NationalGeographic')
184             for entry_url in re.findall('(?s)<div[^>]+class="col-inner"[^>]*?>.*?<a[^>]+href="([^"]+)"', webpage)]
185         return self.playlist_result(
186             entries, '%s-%s' % (display_id, selected_season.lower().replace(' ', '-')),
187             '%s - %s' % (show, selected_season))
188
```
--- 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/nationalgeographic.py b/youtube_dl/extractor/nationalgeographic.py
--- a/youtube_dl/extractor/nationalgeographic.py
+++ b/youtube_dl/extractor/nationalgeographic.py
@@ -68,11 +68,11 @@
 
 class NationalGeographicIE(ThePlatformIE, AdobePassIE):
     IE_NAME = 'natgeo'
-    _VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:(?:wild/)?[^/]+/)?(?:videos|episodes)/(?P<id>[^/?]+)'
+    _VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:(?:(?:wild/)?[^/]+/)?(?:videos|episodes)|u)/(?P<id>[^/?]+)'
 
     _TESTS = [
         {
-            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',
+            'url': 'http://channel.nationalgeographic.com/u/kdi9Ld0PN2molUUIMSBGxoeDhD729KRjQcnxtetilWPMevo8ZwUBIDuPR0Q3D2LVaTsk0MPRkRWDB8ZhqWVeyoxfsZZm36yRp1j-zPfsHEyI_EgAeFY/',
             'md5': '518c9aa655686cf81493af5cc21e2a04',
             'info_dict': {
                 'id': 'vKInpacll2pC',
@@ -86,7 +86,7 @@
             'add_ie': ['ThePlatform'],
         },
         {
-            'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',
+            'url': 'http://channel.nationalgeographic.com/u/kdvOstqYaBY-vSBPyYgAZRUL4sWUJ5XUUPEhc7ISyBHqoIO4_dzfY3K6EjHIC0hmFXoQ7Cpzm6RkET7S3oMlm6CFnrQwSUwo/',
             'md5': 'c4912f656b4cbe58f3e000c489360989',
             'info_dict': {
                 'id': 'Pok5lWCkiEFA',
@@ -106,6 +106,14 @@
         {
             'url': 'http://channel.nationalgeographic.com/videos/treasures-rediscovered/',
             'only_matching': True,
+        },
+        {
+            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',
+            'only_matching': True,
+        },
+        {
+            'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',
+            'only_matching': True,
         }
     ]

{"golden_diff": "diff --git a/youtube_dl/extractor/nationalgeographic.py b/youtube_dl/extractor/nationalgeographic.py\n--- a/youtube_dl/extractor/nationalgeographic.py\n+++ b/youtube_dl/extractor/nationalgeographic.py\n@@ -68,11 +68,11 @@\n \n class NationalGeographicIE(ThePlatformIE, AdobePassIE):\n     IE_NAME = 'natgeo'\n-    _VALID_URL = r'https?://channel\\.nationalgeographic\\.com/(?:(?:wild/)?[^/]+/)?(?:videos|episodes)/(?P<id>[^/?]+)'\n+    _VALID_URL = r'https?://channel\\.nationalgeographic\\.com/(?:(?:(?:wild/)?[^/]+/)?(?:videos|episodes)|u)/(?P<id>[^/?]+)'\n \n     _TESTS = [\n         {\n-            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',\n+            'url': 'http://channel.nationalgeographic.com/u/kdi9Ld0PN2molUUIMSBGxoeDhD729KRjQcnxtetilWPMevo8ZwUBIDuPR0Q3D2LVaTsk0MPRkRWDB8ZhqWVeyoxfsZZm36yRp1j-zPfsHEyI_EgAeFY/',\n             'md5': '518c9aa655686cf81493af5cc21e2a04',\n             'info_dict': {\n                 'id': 'vKInpacll2pC',\n@@ -86,7 +86,7 @@\n             'add_ie': ['ThePlatform'],\n         },\n         {\n-            'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',\n+            'url': 'http://channel.nationalgeographic.com/u/kdvOstqYaBY-vSBPyYgAZRUL4sWUJ5XUUPEhc7ISyBHqoIO4_dzfY3K6EjHIC0hmFXoQ7Cpzm6RkET7S3oMlm6CFnrQwSUwo/',\n             'md5': 'c4912f656b4cbe58f3e000c489360989',\n             'info_dict': {\n                 'id': 'Pok5lWCkiEFA',\n@@ -106,6 +106,14 @@\n         {\n             'url': 'http://channel.nationalgeographic.com/videos/treasures-rediscovered/',\n             'only_matching': True,\n+        },\n+        {\n+            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',\n+            'only_matching': True,\n+        },\n+        {\n+            'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',\n+            'only_matching': True,\n         }\n     ]\n", "issue": "Unable to download videos from http://channel.nationalgeographic.com.\nExample:\r\n\r\n$ youtube-dl -v \"http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/\"\r\n[debug] System config: []\r\n[debug] User config: []\r\n[debug] Custom config: []\r\n[debug] Command-line args: ['-v', 'http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/']\r\n[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8\r\n[debug] youtube-dl version 2018.03.26.1\r\n[debug] Python version 3.4.2 (CPython) - Linux-3.16.0-5-amd64-x86_64-with-debian-8.10\r\n[debug] exe versions: ffmpeg 3.2.10-1, ffprobe 3.2.10-1, rtmpdump 2.4\r\n[debug] Proxy map: {}\r\n[generic] kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg: Requesting header\r\nWARNING: Falling back on generic information extractor.\r\n[generic] kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg: Downloading webpage\r\n[generic] kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg: Extracting information\r\nERROR: Unsupported URL: http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/\r\nTraceback (most recent call last):\r\n  File \"/home/ant/bin/youtube-dl/youtube_dl/YoutubeDL.py\", line 785, in extract_info\r\n    ie_result = ie.extract(url)\r\n  File \"/home/ant/bin/youtube-dl/youtube_dl/extractor/common.py\", line 440, in extract\r\n    ie_result = self._real_extract(url)\r\n  File \"/home/ant/bin/youtube-dl/youtube_dl/extractor/generic.py\", line 3143, in _real_extract\r\n    raise UnsupportedError(url)\r\nyoutube_dl.utils.UnsupportedError: Unsupported URL: http://channel.nationalgeographic.com/u/kcOIVhcWjca1n65QtmFg_5vIMZ9j1S1CXT46o65HkAANx6SUvJvQAQfYjGC0CkQwGNSgnX54f2aoFg/\r\n\r\nThank you in advance. :)\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom .adobepass import AdobePassIE\nfrom .theplatform import ThePlatformIE\nfrom ..utils import (\n    smuggle_url,\n    url_basename,\n    update_url_query,\n    get_element_by_class,\n)\n\n\nclass NationalGeographicVideoIE(InfoExtractor):\n    IE_NAME = 'natgeo:video'\n    _VALID_URL = r'https?://video\\.nationalgeographic\\.com/.*?'\n\n    _TESTS = [\n        {\n            'url': 'http://video.nationalgeographic.com/video/news/150210-news-crab-mating-vin?source=featuredvideo',\n            'md5': '730855d559abbad6b42c2be1fa584917',\n            'info_dict': {\n                'id': '0000014b-70a1-dd8c-af7f-f7b559330001',\n                'ext': 'mp4',\n                'title': 'Mating Crabs Busted by Sharks',\n                'description': 'md5:16f25aeffdeba55aaa8ec37e093ad8b3',\n                'timestamp': 1423523799,\n                'upload_date': '20150209',\n                'uploader': 'NAGS',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n        {\n            'url': 'http://video.nationalgeographic.com/wild/when-sharks-attack/the-real-jaws',\n            'md5': '6a3105eb448c070503b3105fb9b320b5',\n            'info_dict': {\n                'id': 'ngc-I0IauNSWznb_UV008GxSbwY35BZvgi2e',\n                'ext': 'mp4',\n                'title': 'The Real Jaws',\n                'description': 'md5:8d3e09d9d53a85cd397b4b21b2c77be6',\n                'timestamp': 1433772632,\n                'upload_date': '20150608',\n                'uploader': 'NAGS',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n    ]\n\n    def _real_extract(self, url):\n        name = url_basename(url)\n\n        webpage = self._download_webpage(url, name)\n        guid = self._search_regex(\n            r'id=\"(?:videoPlayer|player-container)\"[^>]+data-guid=\"([^\"]+)\"',\n            webpage, 'guid')\n\n        return {\n            '_type': 'url_transparent',\n            'ie_key': 'ThePlatform',\n            'url': smuggle_url(\n                'http://link.theplatform.com/s/ngs/media/guid/2423130747/%s?mbr=true' % guid,\n                {'force_smil_url': True}),\n            'id': guid,\n        }\n\n\nclass NationalGeographicIE(ThePlatformIE, AdobePassIE):\n    IE_NAME = 'natgeo'\n    _VALID_URL = r'https?://channel\\.nationalgeographic\\.com/(?:(?:wild/)?[^/]+/)?(?:videos|episodes)/(?P<id>[^/?]+)'\n\n    _TESTS = [\n        {\n            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',\n            'md5': '518c9aa655686cf81493af5cc21e2a04',\n            'info_dict': {\n                'id': 'vKInpacll2pC',\n                'ext': 'mp4',\n                'title': 'Uncovering a Universal Knowledge',\n                'description': 'md5:1a89148475bf931b3661fcd6ddb2ae3a',\n                'timestamp': 1458680907,\n                'upload_date': '20160322',\n                'uploader': 'NEWA-FNG-NGTV',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',\n            'md5': 'c4912f656b4cbe58f3e000c489360989',\n            'info_dict': {\n                'id': 'Pok5lWCkiEFA',\n                'ext': 'mp4',\n                'title': 'The Stunning Red Bird of Paradise',\n                'description': 'md5:7bc8cd1da29686be4d17ad1230f0140c',\n                'timestamp': 1459362152,\n                'upload_date': '20160330',\n                'uploader': 'NEWA-FNG-NGTV',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/episodes/the-power-of-miracles/',\n            'only_matching': True,\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/videos/treasures-rediscovered/',\n            'only_matching': True,\n        }\n    ]\n\n    def _real_extract(self, url):\n        display_id = self._match_id(url)\n        webpage = self._download_webpage(url, display_id)\n        release_url = self._search_regex(\n            r'video_auth_playlist_url\\s*=\\s*\"([^\"]+)\"',\n            webpage, 'release url')\n        theplatform_path = self._search_regex(r'https?://link\\.theplatform\\.com/s/([^?]+)', release_url, 'theplatform path')\n        video_id = theplatform_path.split('/')[-1]\n        query = {\n            'mbr': 'true',\n        }\n        is_auth = self._search_regex(r'video_is_auth\\s*=\\s*\"([^\"]+)\"', webpage, 'is auth', fatal=False)\n        if is_auth == 'auth':\n            auth_resource_id = self._search_regex(\n                r\"video_auth_resourceId\\s*=\\s*'([^']+)'\",\n                webpage, 'auth resource id')\n            query['auth'] = self._extract_mvpd_auth(url, video_id, 'natgeo', auth_resource_id)\n\n        formats = []\n        subtitles = {}\n        for key, value in (('switch', 'http'), ('manifest', 'm3u')):\n            tp_query = query.copy()\n            tp_query.update({\n                key: value,\n            })\n            tp_formats, tp_subtitles = self._extract_theplatform_smil(\n                update_url_query(release_url, tp_query), video_id, 'Downloading %s SMIL data' % value)\n            formats.extend(tp_formats)\n            subtitles = self._merge_subtitles(subtitles, tp_subtitles)\n        self._sort_formats(formats)\n\n        info = self._extract_theplatform_metadata(theplatform_path, display_id)\n        info.update({\n            'id': video_id,\n            'formats': formats,\n            'subtitles': subtitles,\n            'display_id': display_id,\n        })\n        return info\n\n\nclass NationalGeographicEpisodeGuideIE(InfoExtractor):\n    IE_NAME = 'natgeo:episodeguide'\n    _VALID_URL = r'https?://channel\\.nationalgeographic\\.com/(?:wild/)?(?P<id>[^/]+)/episode-guide'\n    _TESTS = [\n        {\n            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/episode-guide/',\n            'info_dict': {\n                'id': 'the-story-of-god-with-morgan-freeman-season-1',\n                'title': 'The Story of God with Morgan Freeman - Season 1',\n            },\n            'playlist_mincount': 6,\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/underworld-inc/episode-guide/?s=2',\n            'info_dict': {\n                'id': 'underworld-inc-season-2',\n                'title': 'Underworld, Inc. - Season 2',\n            },\n            'playlist_mincount': 7,\n        },\n    ]\n\n    def _real_extract(self, url):\n        display_id = self._match_id(url)\n        webpage = self._download_webpage(url, display_id)\n        show = get_element_by_class('show', webpage)\n        selected_season = self._search_regex(\n            r'<div[^>]+class=\"select-seasons[^\"]*\".*?<a[^>]*>(.*?)</a>',\n            webpage, 'selected season')\n        entries = [\n            self.url_result(self._proto_relative_url(entry_url), 'NationalGeographic')\n            for entry_url in re.findall('(?s)<div[^>]+class=\"col-inner\"[^>]*?>.*?<a[^>]+href=\"([^\"]+)\"', webpage)]\n        return self.playlist_result(\n            entries, '%s-%s' % (display_id, selected_season.lower().replace(' ', '-')),\n            '%s - %s' % (show, selected_season))\n", "path": "youtube_dl/extractor/nationalgeographic.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom .adobepass import AdobePassIE\nfrom .theplatform import ThePlatformIE\nfrom ..utils import (\n    smuggle_url,\n    url_basename,\n    update_url_query,\n    get_element_by_class,\n)\n\n\nclass NationalGeographicVideoIE(InfoExtractor):\n    IE_NAME = 'natgeo:video'\n    _VALID_URL = r'https?://video\\.nationalgeographic\\.com/.*?'\n\n    _TESTS = [\n        {\n            'url': 'http://video.nationalgeographic.com/video/news/150210-news-crab-mating-vin?source=featuredvideo',\n            'md5': '730855d559abbad6b42c2be1fa584917',\n            'info_dict': {\n                'id': '0000014b-70a1-dd8c-af7f-f7b559330001',\n                'ext': 'mp4',\n                'title': 'Mating Crabs Busted by Sharks',\n                'description': 'md5:16f25aeffdeba55aaa8ec37e093ad8b3',\n                'timestamp': 1423523799,\n                'upload_date': '20150209',\n                'uploader': 'NAGS',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n        {\n            'url': 'http://video.nationalgeographic.com/wild/when-sharks-attack/the-real-jaws',\n            'md5': '6a3105eb448c070503b3105fb9b320b5',\n            'info_dict': {\n                'id': 'ngc-I0IauNSWznb_UV008GxSbwY35BZvgi2e',\n                'ext': 'mp4',\n                'title': 'The Real Jaws',\n                'description': 'md5:8d3e09d9d53a85cd397b4b21b2c77be6',\n                'timestamp': 1433772632,\n                'upload_date': '20150608',\n                'uploader': 'NAGS',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n    ]\n\n    def _real_extract(self, url):\n        name = url_basename(url)\n\n        webpage = self._download_webpage(url, name)\n        guid = self._search_regex(\n            r'id=\"(?:videoPlayer|player-container)\"[^>]+data-guid=\"([^\"]+)\"',\n            webpage, 'guid')\n\n        return {\n            '_type': 'url_transparent',\n            'ie_key': 'ThePlatform',\n            'url': smuggle_url(\n                'http://link.theplatform.com/s/ngs/media/guid/2423130747/%s?mbr=true' % guid,\n                {'force_smil_url': True}),\n            'id': guid,\n        }\n\n\nclass NationalGeographicIE(ThePlatformIE, AdobePassIE):\n    IE_NAME = 'natgeo'\n    _VALID_URL = r'https?://channel\\.nationalgeographic\\.com/(?:(?:(?:wild/)?[^/]+/)?(?:videos|episodes)|u)/(?P<id>[^/?]+)'\n\n    _TESTS = [\n        {\n            'url': 'http://channel.nationalgeographic.com/u/kdi9Ld0PN2molUUIMSBGxoeDhD729KRjQcnxtetilWPMevo8ZwUBIDuPR0Q3D2LVaTsk0MPRkRWDB8ZhqWVeyoxfsZZm36yRp1j-zPfsHEyI_EgAeFY/',\n            'md5': '518c9aa655686cf81493af5cc21e2a04',\n            'info_dict': {\n                'id': 'vKInpacll2pC',\n                'ext': 'mp4',\n                'title': 'Uncovering a Universal Knowledge',\n                'description': 'md5:1a89148475bf931b3661fcd6ddb2ae3a',\n                'timestamp': 1458680907,\n                'upload_date': '20160322',\n                'uploader': 'NEWA-FNG-NGTV',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/u/kdvOstqYaBY-vSBPyYgAZRUL4sWUJ5XUUPEhc7ISyBHqoIO4_dzfY3K6EjHIC0hmFXoQ7Cpzm6RkET7S3oMlm6CFnrQwSUwo/',\n            'md5': 'c4912f656b4cbe58f3e000c489360989',\n            'info_dict': {\n                'id': 'Pok5lWCkiEFA',\n                'ext': 'mp4',\n                'title': 'The Stunning Red Bird of Paradise',\n                'description': 'md5:7bc8cd1da29686be4d17ad1230f0140c',\n                'timestamp': 1459362152,\n                'upload_date': '20160330',\n                'uploader': 'NEWA-FNG-NGTV',\n            },\n            'add_ie': ['ThePlatform'],\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/episodes/the-power-of-miracles/',\n            'only_matching': True,\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/videos/treasures-rediscovered/',\n            'only_matching': True,\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/videos/uncovering-a-universal-knowledge/',\n            'only_matching': True,\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/wild/destination-wild/videos/the-stunning-red-bird-of-paradise/',\n            'only_matching': True,\n        }\n    ]\n\n    def _real_extract(self, url):\n        display_id = self._match_id(url)\n        webpage = self._download_webpage(url, display_id)\n        release_url = self._search_regex(\n            r'video_auth_playlist_url\\s*=\\s*\"([^\"]+)\"',\n            webpage, 'release url')\n        theplatform_path = self._search_regex(r'https?://link\\.theplatform\\.com/s/([^?]+)', release_url, 'theplatform path')\n        video_id = theplatform_path.split('/')[-1]\n        query = {\n            'mbr': 'true',\n        }\n        is_auth = self._search_regex(r'video_is_auth\\s*=\\s*\"([^\"]+)\"', webpage, 'is auth', fatal=False)\n        if is_auth == 'auth':\n            auth_resource_id = self._search_regex(\n                r\"video_auth_resourceId\\s*=\\s*'([^']+)'\",\n                webpage, 'auth resource id')\n            query['auth'] = self._extract_mvpd_auth(url, video_id, 'natgeo', auth_resource_id)\n\n        formats = []\n        subtitles = {}\n        for key, value in (('switch', 'http'), ('manifest', 'm3u')):\n            tp_query = query.copy()\n            tp_query.update({\n                key: value,\n            })\n            tp_formats, tp_subtitles = self._extract_theplatform_smil(\n                update_url_query(release_url, tp_query), video_id, 'Downloading %s SMIL data' % value)\n            formats.extend(tp_formats)\n            subtitles = self._merge_subtitles(subtitles, tp_subtitles)\n        self._sort_formats(formats)\n\n        info = self._extract_theplatform_metadata(theplatform_path, display_id)\n        info.update({\n            'id': video_id,\n            'formats': formats,\n            'subtitles': subtitles,\n            'display_id': display_id,\n        })\n        return info\n\n\nclass NationalGeographicEpisodeGuideIE(InfoExtractor):\n    IE_NAME = 'natgeo:episodeguide'\n    _VALID_URL = r'https?://channel\\.nationalgeographic\\.com/(?:wild/)?(?P<id>[^/]+)/episode-guide'\n    _TESTS = [\n        {\n            'url': 'http://channel.nationalgeographic.com/the-story-of-god-with-morgan-freeman/episode-guide/',\n            'info_dict': {\n                'id': 'the-story-of-god-with-morgan-freeman-season-1',\n                'title': 'The Story of God with Morgan Freeman - Season 1',\n            },\n            'playlist_mincount': 6,\n        },\n        {\n            'url': 'http://channel.nationalgeographic.com/underworld-inc/episode-guide/?s=2',\n            'info_dict': {\n                'id': 'underworld-inc-season-2',\n                'title': 'Underworld, Inc. - Season 2',\n            },\n            'playlist_mincount': 7,\n        },\n    ]\n\n    def _real_extract(self, url):\n        display_id = self._match_id(url)\n        webpage = self._download_webpage(url, display_id)\n        show = get_element_by_class('show', webpage)\n        selected_season = self._search_regex(\n            r'<div[^>]+class=\"select-seasons[^\"]*\".*?<a[^>]*>(.*?)</a>',\n            webpage, 'selected season')\n        entries = [\n            self.url_result(self._proto_relative_url(entry_url), 'NationalGeographic')\n            for entry_url in re.findall('(?s)<div[^>]+class=\"col-inner\"[^>]*?>.*?<a[^>]+href=\"([^\"]+)\"', webpage)]\n        return self.playlist_result(\n            entries, '%s-%s' % (display_id, selected_season.lower().replace(' ', '-')),\n            '%s - %s' % (show, selected_season))\n", "path": "youtube_dl/extractor/nationalgeographic.py"}]}