We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Ustream extractor does not recognize URLs of the form www.ustream.tv/embed/recorded/<ID>
The ustream extractor looks for URLs with either 'embed' or 'recorded', but Ustream allows sites to embed with URLs of this form:
http://www.ustream.tv/embed/recorded/44195705

An example is at http://inside.twit.tv/blog/2014/5/14/ustream-goes-behind-the-scenes-at-twit.html, which gives this result from youtube_dl:

python -m youtube_dl --skip-download --write-info-json -v http://inside.twit.tv/blog/2014/5/14/ustream-goes-behind-the-scenes-at-twit.html
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--skip-download', '--write-info-json', '-v', 'http://inside.twit.tv/blog/2014/5/14/ustream-goes-behind-the-scenes-at-twit.html']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.05.13
[debug] Python version 2.7.5 - Darwin-13.2.0-x86_64-i386-64bit
[debug] Proxy map: {}
[generic] ustream-goes-behind-the-scenes-at-twit: Requesting header
WARNING: Falling back on generic information extractor.
[generic] ustream-goes-behind-the-scenes-at-twit: Downloading webpage
[generic] ustream-goes-behind-the-scenes-at-twit: Extracting information
ERROR: no suitable InfoExtractor for URL http://www.ustream.tv/embed/recorded/44195705?v=3&amp;wmode=direct#to13:09
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/__main__.py", line 18, in <module>
    youtube_dl.main()
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/**init**.py", line 849, in main
    _real_main(argv)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/__init__.py", line 839, in _real_main
    retcode = ydl.download(all_urls)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1039, in download
    self.extract_info(url)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 527, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 571, in process_ie_result
    extra_info=extra_info)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 542, in extract_info
    self.report_error('no suitable InfoExtractor for URL %s' % url)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 405, in report_error
    self.trouble(error_message, tb)
  File "/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 367, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())


--- 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/ustream.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 import json
4 import re
5 
6 from .common import InfoExtractor
7 from ..utils import (
8     compat_urlparse,
9     get_meta_content,
10 )
11 
12 
13 class UstreamIE(InfoExtractor):
14     _VALID_URL = r'https?://www\.ustream\.tv/(?P<type>recorded|embed)/(?P<videoID>\d+)'
15     IE_NAME = 'ustream'
16     _TEST = {
17         'url': 'http://www.ustream.tv/recorded/20274954',
18         'file': '20274954.flv',
19         'md5': '088f151799e8f572f84eb62f17d73e5c',
20         'info_dict': {
21             "uploader": "Young Americans for Liberty",
22             "title": "Young Americans for Liberty February 7, 2012 2:28 AM",
23         },
24     }
25 
26     def _real_extract(self, url):
27         m = re.match(self._VALID_URL, url)
28         if m.group('type') == 'embed':
29             video_id = m.group('videoID')
30             webpage = self._download_webpage(url, video_id)
31             desktop_video_id = self._html_search_regex(r'ContentVideoIds=\["([^"]*?)"\]', webpage, 'desktop_video_id')
32             desktop_url = 'http://www.ustream.tv/recorded/' + desktop_video_id
33             return self.url_result(desktop_url, 'Ustream')
34 
35         video_id = m.group('videoID')
36 
37         video_url = 'http://tcdn.ustream.tv/video/%s' % video_id
38         webpage = self._download_webpage(url, video_id)
39 
40         self.report_extraction(video_id)
41 
42         video_title = self._html_search_regex(r'data-title="(?P<title>.+)"',
43             webpage, 'title')
44 
45         uploader = self._html_search_regex(r'data-content-type="channel".*?>(?P<uploader>.*?)</a>',
46             webpage, 'uploader', fatal=False, flags=re.DOTALL)
47 
48         thumbnail = self._html_search_regex(r'<link rel="image_src" href="(?P<thumb>.*?)"',
49             webpage, 'thumbnail', fatal=False)
50 
51         return {
52             'id': video_id,
53             'url': video_url,
54             'ext': 'flv',
55             'title': video_title,
56             'uploader': uploader,
57             'thumbnail': thumbnail,
58         }
59 
60 
61 class UstreamChannelIE(InfoExtractor):
62     _VALID_URL = r'https?://www\.ustream\.tv/channel/(?P<slug>.+)'
63     IE_NAME = 'ustream:channel'
64 
65     def _real_extract(self, url):
66         m = re.match(self._VALID_URL, url)
67         slug = m.group('slug')
68         webpage = self._download_webpage(url, slug)
69         channel_id = get_meta_content('ustream:channel_id', webpage)
70 
71         BASE = 'http://www.ustream.tv'
72         next_url = '/ajax/socialstream/videos/%s/1.json' % channel_id
73         video_ids = []
74         while next_url:
75             reply = json.loads(self._download_webpage(compat_urlparse.urljoin(BASE, next_url), channel_id))
76             video_ids.extend(re.findall(r'data-content-id="(\d.*)"', reply['data']))
77             next_url = reply['nextUrl']
78 
79         urls = ['http://www.ustream.tv/recorded/' + vid for vid in video_ids]
80         url_entries = [self.url_result(eurl, 'Ustream') for eurl in urls]
81         return self.playlist_result(url_entries, channel_id)
82
```
--- 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/ustream.py b/youtube_dl/extractor/ustream.py
--- a/youtube_dl/extractor/ustream.py
+++ b/youtube_dl/extractor/ustream.py
@@ -11,7 +11,7 @@
 
 
 class UstreamIE(InfoExtractor):
-    _VALID_URL = r'https?://www\.ustream\.tv/(?P<type>recorded|embed)/(?P<videoID>\d+)'
+    _VALID_URL = r'https?://www\.ustream\.tv/(?P<type>recorded|embed|embed/recorded)/(?P<videoID>\d+)'
     IE_NAME = 'ustream'
     _TEST = {
         'url': 'http://www.ustream.tv/recorded/20274954',
@@ -25,6 +25,13 @@
 
     def _real_extract(self, url):
         m = re.match(self._VALID_URL, url)
+        video_id = m.group('videoID')
+
+        if m.group('type') == 'embed/recorded': # some sites use this embed format (see: http://github.com/rg3/youtube-dl/issues/2990)
+            video_id = m.group('videoID')
+            webpage = self._download_webpage(url, video_id, note="Downloading embedded Ustream page")
+            desktop_url = 'http://www.ustream.tv/recorded/' + video_id
+            return self.url_result(desktop_url, 'Ustream')
         if m.group('type') == 'embed':
             video_id = m.group('videoID')
             webpage = self._download_webpage(url, video_id)
@@ -32,8 +39,6 @@
             desktop_url = 'http://www.ustream.tv/recorded/' + desktop_video_id
             return self.url_result(desktop_url, 'Ustream')
 
-        video_id = m.group('videoID')
-
         video_url = 'http://tcdn.ustream.tv/video/%s' % video_id
         webpage = self._download_webpage(url, video_id)

{"golden_diff": "diff --git a/youtube_dl/extractor/ustream.py b/youtube_dl/extractor/ustream.py\n--- a/youtube_dl/extractor/ustream.py\n+++ b/youtube_dl/extractor/ustream.py\n@@ -11,7 +11,7 @@\n \n \n class UstreamIE(InfoExtractor):\n-    _VALID_URL = r'https?://www\\.ustream\\.tv/(?P<type>recorded|embed)/(?P<videoID>\\d+)'\n+    _VALID_URL = r'https?://www\\.ustream\\.tv/(?P<type>recorded|embed|embed/recorded)/(?P<videoID>\\d+)'\n     IE_NAME = 'ustream'\n     _TEST = {\n         'url': 'http://www.ustream.tv/recorded/20274954',\n@@ -25,6 +25,13 @@\n \n     def _real_extract(self, url):\n         m = re.match(self._VALID_URL, url)\n+        video_id = m.group('videoID')\n+\n+        if m.group('type') == 'embed/recorded': # some sites use this embed format (see: http://github.com/rg3/youtube-dl/issues/2990)\n+            video_id = m.group('videoID')\n+            webpage = self._download_webpage(url, video_id, note=\"Downloading embedded Ustream page\")\n+            desktop_url = 'http://www.ustream.tv/recorded/' + video_id\n+            return self.url_result(desktop_url, 'Ustream')\n         if m.group('type') == 'embed':\n             video_id = m.group('videoID')\n             webpage = self._download_webpage(url, video_id)\n@@ -32,8 +39,6 @@\n             desktop_url = 'http://www.ustream.tv/recorded/' + desktop_video_id\n             return self.url_result(desktop_url, 'Ustream')\n \n-        video_id = m.group('videoID')\n-\n         video_url = 'http://tcdn.ustream.tv/video/%s' % video_id\n         webpage = self._download_webpage(url, video_id)\n", "issue": "Ustream extractor does not recognize URLs of the form www.ustream.tv/embed/recorded/<ID>\nThe ustream extractor looks for URLs with either 'embed' or 'recorded', but Ustream allows sites to embed with URLs of this form:\nhttp://www.ustream.tv/embed/recorded/44195705\n\nAn example is at http://inside.twit.tv/blog/2014/5/14/ustream-goes-behind-the-scenes-at-twit.html, which gives this result from youtube_dl:\n\npython -m youtube_dl --skip-download --write-info-json -v http://inside.twit.tv/blog/2014/5/14/ustream-goes-behind-the-scenes-at-twit.html\n[debug] System config: []\n[debug] User config: []\n[debug] Command-line args: ['--skip-download', '--write-info-json', '-v', 'http://inside.twit.tv/blog/2014/5/14/ustream-goes-behind-the-scenes-at-twit.html']\n[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8\n[debug] youtube-dl version 2014.05.13\n[debug] Python version 2.7.5 - Darwin-13.2.0-x86_64-i386-64bit\n[debug] Proxy map: {}\n[generic] ustream-goes-behind-the-scenes-at-twit: Requesting header\nWARNING: Falling back on generic information extractor.\n[generic] ustream-goes-behind-the-scenes-at-twit: Downloading webpage\n[generic] ustream-goes-behind-the-scenes-at-twit: Extracting information\nERROR: no suitable InfoExtractor for URL http://www.ustream.tv/embed/recorded/44195705?v=3&amp;wmode=direct#to13:09\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\n    \"__main__\", fname, loader, pkg_name)\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/__main__.py\", line 18, in <module>\n    youtube_dl.main()\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/**init**.py\", line 849, in main\n    _real_main(argv)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/__init__.py\", line 839, in _real_main\n    retcode = ydl.download(all_urls)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py\", line 1039, in download\n    self.extract_info(url)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py\", line 527, in extract_info\n    return self.process_ie_result(ie_result, download, extra_info)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py\", line 571, in process_ie_result\n    extra_info=extra_info)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py\", line 542, in extract_info\n    self.report_error('no suitable InfoExtractor for URL %s' % url)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py\", line 405, in report_error\n    self.trouble(error_message, tb)\n  File \"/Users/jill/june/.virtualenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py\", line 367, in trouble\n    tb_data = traceback.format_list(traceback.extract_stack())\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport json\nimport re\n\nfrom .common import InfoExtractor\nfrom ..utils import (\n    compat_urlparse,\n    get_meta_content,\n)\n\n\nclass UstreamIE(InfoExtractor):\n    _VALID_URL = r'https?://www\\.ustream\\.tv/(?P<type>recorded|embed)/(?P<videoID>\\d+)'\n    IE_NAME = 'ustream'\n    _TEST = {\n        'url': 'http://www.ustream.tv/recorded/20274954',\n        'file': '20274954.flv',\n        'md5': '088f151799e8f572f84eb62f17d73e5c',\n        'info_dict': {\n            \"uploader\": \"Young Americans for Liberty\",\n            \"title\": \"Young Americans for Liberty February 7, 2012 2:28 AM\",\n        },\n    }\n\n    def _real_extract(self, url):\n        m = re.match(self._VALID_URL, url)\n        if m.group('type') == 'embed':\n            video_id = m.group('videoID')\n            webpage = self._download_webpage(url, video_id)\n            desktop_video_id = self._html_search_regex(r'ContentVideoIds=\\[\"([^\"]*?)\"\\]', webpage, 'desktop_video_id')\n            desktop_url = 'http://www.ustream.tv/recorded/' + desktop_video_id\n            return self.url_result(desktop_url, 'Ustream')\n\n        video_id = m.group('videoID')\n\n        video_url = 'http://tcdn.ustream.tv/video/%s' % video_id\n        webpage = self._download_webpage(url, video_id)\n\n        self.report_extraction(video_id)\n\n        video_title = self._html_search_regex(r'data-title=\"(?P<title>.+)\"',\n            webpage, 'title')\n\n        uploader = self._html_search_regex(r'data-content-type=\"channel\".*?>(?P<uploader>.*?)</a>',\n            webpage, 'uploader', fatal=False, flags=re.DOTALL)\n\n        thumbnail = self._html_search_regex(r'<link rel=\"image_src\" href=\"(?P<thumb>.*?)\"',\n            webpage, 'thumbnail', fatal=False)\n\n        return {\n            'id': video_id,\n            'url': video_url,\n            'ext': 'flv',\n            'title': video_title,\n            'uploader': uploader,\n            'thumbnail': thumbnail,\n        }\n\n\nclass UstreamChannelIE(InfoExtractor):\n    _VALID_URL = r'https?://www\\.ustream\\.tv/channel/(?P<slug>.+)'\n    IE_NAME = 'ustream:channel'\n\n    def _real_extract(self, url):\n        m = re.match(self._VALID_URL, url)\n        slug = m.group('slug')\n        webpage = self._download_webpage(url, slug)\n        channel_id = get_meta_content('ustream:channel_id', webpage)\n\n        BASE = 'http://www.ustream.tv'\n        next_url = '/ajax/socialstream/videos/%s/1.json' % channel_id\n        video_ids = []\n        while next_url:\n            reply = json.loads(self._download_webpage(compat_urlparse.urljoin(BASE, next_url), channel_id))\n            video_ids.extend(re.findall(r'data-content-id=\"(\\d.*)\"', reply['data']))\n            next_url = reply['nextUrl']\n\n        urls = ['http://www.ustream.tv/recorded/' + vid for vid in video_ids]\n        url_entries = [self.url_result(eurl, 'Ustream') for eurl in urls]\n        return self.playlist_result(url_entries, channel_id)\n", "path": "youtube_dl/extractor/ustream.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport json\nimport re\n\nfrom .common import InfoExtractor\nfrom ..utils import (\n    compat_urlparse,\n    get_meta_content,\n)\n\n\nclass UstreamIE(InfoExtractor):\n    _VALID_URL = r'https?://www\\.ustream\\.tv/(?P<type>recorded|embed|embed/recorded)/(?P<videoID>\\d+)'\n    IE_NAME = 'ustream'\n    _TEST = {\n        'url': 'http://www.ustream.tv/recorded/20274954',\n        'file': '20274954.flv',\n        'md5': '088f151799e8f572f84eb62f17d73e5c',\n        'info_dict': {\n            \"uploader\": \"Young Americans for Liberty\",\n            \"title\": \"Young Americans for Liberty February 7, 2012 2:28 AM\",\n        },\n    }\n\n    def _real_extract(self, url):\n        m = re.match(self._VALID_URL, url)\n        video_id = m.group('videoID')\n\n        if m.group('type') == 'embed/recorded': # some sites use this embed format (see: http://github.com/rg3/youtube-dl/issues/2990)\n            video_id = m.group('videoID')\n            webpage = self._download_webpage(url, video_id, note=\"Downloading embedded Ustream page\")\n            desktop_url = 'http://www.ustream.tv/recorded/' + video_id\n            return self.url_result(desktop_url, 'Ustream')\n        if m.group('type') == 'embed':\n            video_id = m.group('videoID')\n            webpage = self._download_webpage(url, video_id)\n            desktop_video_id = self._html_search_regex(r'ContentVideoIds=\\[\"([^\"]*?)\"\\]', webpage, 'desktop_video_id')\n            desktop_url = 'http://www.ustream.tv/recorded/' + desktop_video_id\n            return self.url_result(desktop_url, 'Ustream')\n\n        video_url = 'http://tcdn.ustream.tv/video/%s' % video_id\n        webpage = self._download_webpage(url, video_id)\n\n        self.report_extraction(video_id)\n\n        video_title = self._html_search_regex(r'data-title=\"(?P<title>.+)\"',\n            webpage, 'title')\n\n        uploader = self._html_search_regex(r'data-content-type=\"channel\".*?>(?P<uploader>.*?)</a>',\n            webpage, 'uploader', fatal=False, flags=re.DOTALL)\n\n        thumbnail = self._html_search_regex(r'<link rel=\"image_src\" href=\"(?P<thumb>.*?)\"',\n            webpage, 'thumbnail', fatal=False)\n\n        return {\n            'id': video_id,\n            'url': video_url,\n            'ext': 'flv',\n            'title': video_title,\n            'uploader': uploader,\n            'thumbnail': thumbnail,\n        }\n\n\nclass UstreamChannelIE(InfoExtractor):\n    _VALID_URL = r'https?://www\\.ustream\\.tv/channel/(?P<slug>.+)'\n    IE_NAME = 'ustream:channel'\n\n    def _real_extract(self, url):\n        m = re.match(self._VALID_URL, url)\n        slug = m.group('slug')\n        webpage = self._download_webpage(url, slug)\n        channel_id = get_meta_content('ustream:channel_id', webpage)\n\n        BASE = 'http://www.ustream.tv'\n        next_url = '/ajax/socialstream/videos/%s/1.json' % channel_id\n        video_ids = []\n        while next_url:\n            reply = json.loads(self._download_webpage(compat_urlparse.urljoin(BASE, next_url), channel_id))\n            video_ids.extend(re.findall(r'data-content-id=\"(\\d.*)\"', reply['data']))\n            next_url = reply['nextUrl']\n\n        urls = ['http://www.ustream.tv/recorded/' + vid for vid in video_ids]\n        url_entries = [self.url_result(eurl, 'Ustream') for eurl in urls]\n        return self.playlist_result(url_entries, channel_id)\n", "path": "youtube_dl/extractor/ustream.py"}]}