We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
4tube.com doesn't work anymore
## Please follow the guide below

- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x])
- Use *Preview* tab to see how your issue will actually look like

---

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.06.12*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [X] I've **verified** and **I assure** that I'm running youtube-dl **2017.06.12**

### Before submitting an *issue* make sure you have:
- [X] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [X] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones

### What is the purpose of your *issue*?
- [X] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue*

---

### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows:

Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):
```
$ ./youtube-dl -v https://4tube.com/videos/432585/busty-cory-everson-loves-tit-wanking
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://4tube.com/videos/432585/busty-cory-everson-loves-tit-wanking']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.06.12
[debug] Python version 3.6.1 - Linux-4.11.4-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.4.1
[debug] exe versions: ffmpeg 3.3.2, ffprobe 3.3.2
[debug] Proxy map: {}
[4tube] 432585: Downloading webpage
[4tube] 432585: Downloading JSON metadata
ERROR: Unable to download JSON metadata: <urlopen error [Errno -2] Name or service not known> (caused by URLError(gaierror(-2, 'Name or service not known'),))
  File "./youtube-dl/youtube_dl/extractor/common.py", line 502, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "./youtube-dl/youtube_dl/YoutubeDL.py", line 2129, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib64/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "./youtube-dl/youtube_dl/utils.py", line 931, in http_open
    req)
  File "/usr/lib64/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
```

---

### If the purpose of this *issue* is a *site support request* please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**):
- Single video: https://www.youtube.com/watch?v=BaW_jenozKc
- Single video: https://youtu.be/BaW_jenozKc
- Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc

Note that **youtube-dl does not support sites dedicated to [copyright infringement](https://github.com/rg3/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. In order for site support request to be accepted all provided example URLs should not violate any copyrights.

---

### Description of your *issue*, suggested solution and other information

Explanation of your *issue* in arbitrary form goes here. Please make sure the [description is worded well enough to be understood](https://github.com/rg3/youtube-dl#is-the-description-of-the-issue-itself-sufficient). Provide as much context and examples as possible.
If work on your *issue* requires account credentials please provide them or explain how one can obtain them.


--- 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/fourtube.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 import re
4 
5 from .common import InfoExtractor
6 from ..utils import (
7     parse_duration,
8     parse_iso8601,
9     sanitized_Request,
10     str_to_int,
11 )
12 
13 
14 class FourTubeIE(InfoExtractor):
15     IE_NAME = '4tube'
16     _VALID_URL = r'https?://(?:www\.)?4tube\.com/videos/(?P<id>\d+)'
17 
18     _TEST = {
19         'url': 'http://www.4tube.com/videos/209733/hot-babe-holly-michaels-gets-her-ass-stuffed-by-black',
20         'md5': '6516c8ac63b03de06bc8eac14362db4f',
21         'info_dict': {
22             'id': '209733',
23             'ext': 'mp4',
24             'title': 'Hot Babe Holly Michaels gets her ass stuffed by black',
25             'uploader': 'WCP Club',
26             'uploader_id': 'wcp-club',
27             'upload_date': '20131031',
28             'timestamp': 1383263892,
29             'duration': 583,
30             'view_count': int,
31             'like_count': int,
32             'categories': list,
33             'age_limit': 18,
34         }
35     }
36 
37     def _real_extract(self, url):
38         video_id = self._match_id(url)
39         webpage = self._download_webpage(url, video_id)
40 
41         title = self._html_search_meta('name', webpage)
42         timestamp = parse_iso8601(self._html_search_meta(
43             'uploadDate', webpage))
44         thumbnail = self._html_search_meta('thumbnailUrl', webpage)
45         uploader_id = self._html_search_regex(
46             r'<a class="item-to-subscribe" href="[^"]+/channels/([^/"]+)" title="Go to [^"]+ page">',
47             webpage, 'uploader id', fatal=False)
48         uploader = self._html_search_regex(
49             r'<a class="item-to-subscribe" href="[^"]+/channels/[^/"]+" title="Go to ([^"]+) page">',
50             webpage, 'uploader', fatal=False)
51 
52         categories_html = self._search_regex(
53             r'(?s)><i class="icon icon-tag"></i>\s*Categories / Tags\s*.*?<ul class="[^"]*?list[^"]*?">(.*?)</ul>',
54             webpage, 'categories', fatal=False)
55         categories = None
56         if categories_html:
57             categories = [
58                 c.strip() for c in re.findall(
59                     r'(?s)<li><a.*?>(.*?)</a>', categories_html)]
60 
61         view_count = str_to_int(self._search_regex(
62             r'<meta[^>]+itemprop="interactionCount"[^>]+content="UserPlays:([0-9,]+)">',
63             webpage, 'view count', fatal=False))
64         like_count = str_to_int(self._search_regex(
65             r'<meta[^>]+itemprop="interactionCount"[^>]+content="UserLikes:([0-9,]+)">',
66             webpage, 'like count', fatal=False))
67         duration = parse_duration(self._html_search_meta('duration', webpage))
68 
69         media_id = self._search_regex(
70             r'<button[^>]+data-id=(["\'])(?P<id>\d+)\1[^>]+data-quality=', webpage,
71             'media id', default=None, group='id')
72         sources = [
73             quality
74             for _, quality in re.findall(r'<button[^>]+data-quality=(["\'])(.+?)\1', webpage)]
75         if not (media_id and sources):
76             player_js = self._download_webpage(
77                 self._search_regex(
78                     r'<script[^>]id=(["\'])playerembed\1[^>]+src=(["\'])(?P<url>.+?)\2',
79                     webpage, 'player JS', group='url'),
80                 video_id, 'Downloading player JS')
81             params_js = self._search_regex(
82                 r'\$\.ajax\(url,\ opts\);\s*\}\s*\}\)\(([0-9,\[\] ]+)\)',
83                 player_js, 'initialization parameters')
84             params = self._parse_json('[%s]' % params_js, video_id)
85             media_id = params[0]
86             sources = ['%s' % p for p in params[2]]
87 
88         token_url = 'http://tkn.4tube.com/{0}/desktop/{1}'.format(
89             media_id, '+'.join(sources))
90         headers = {
91             b'Content-Type': b'application/x-www-form-urlencoded',
92             b'Origin': b'http://www.4tube.com',
93         }
94         token_req = sanitized_Request(token_url, b'{}', headers)
95         tokens = self._download_json(token_req, video_id)
96         formats = [{
97             'url': tokens[format]['token'],
98             'format_id': format + 'p',
99             'resolution': format + 'p',
100             'quality': int(format),
101         } for format in sources]
102         self._sort_formats(formats)
103 
104         return {
105             'id': video_id,
106             'title': title,
107             'formats': formats,
108             'categories': categories,
109             'thumbnail': thumbnail,
110             'uploader': uploader,
111             'uploader_id': uploader_id,
112             'timestamp': timestamp,
113             'like_count': like_count,
114             'view_count': view_count,
115             'duration': duration,
116             'age_limit': 18,
117         }
118
```
--- 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/fourtube.py b/youtube_dl/extractor/fourtube.py
--- a/youtube_dl/extractor/fourtube.py
+++ b/youtube_dl/extractor/fourtube.py
@@ -85,11 +85,11 @@
             media_id = params[0]
             sources = ['%s' % p for p in params[2]]
 
-        token_url = 'http://tkn.4tube.com/{0}/desktop/{1}'.format(
+        token_url = 'https://tkn.kodicdn.com/{0}/desktop/{1}'.format(
             media_id, '+'.join(sources))
         headers = {
             b'Content-Type': b'application/x-www-form-urlencoded',
-            b'Origin': b'http://www.4tube.com',
+            b'Origin': b'https://www.4tube.com',
         }
         token_req = sanitized_Request(token_url, b'{}', headers)
         tokens = self._download_json(token_req, video_id)

{"golden_diff": "diff --git a/youtube_dl/extractor/fourtube.py b/youtube_dl/extractor/fourtube.py\n--- a/youtube_dl/extractor/fourtube.py\n+++ b/youtube_dl/extractor/fourtube.py\n@@ -85,11 +85,11 @@\n             media_id = params[0]\n             sources = ['%s' % p for p in params[2]]\n \n-        token_url = 'http://tkn.4tube.com/{0}/desktop/{1}'.format(\n+        token_url = 'https://tkn.kodicdn.com/{0}/desktop/{1}'.format(\n             media_id, '+'.join(sources))\n         headers = {\n             b'Content-Type': b'application/x-www-form-urlencoded',\n-            b'Origin': b'http://www.4tube.com',\n+            b'Origin': b'https://www.4tube.com',\n         }\n         token_req = sanitized_Request(token_url, b'{}', headers)\n         tokens = self._download_json(token_req, video_id)\n", "issue": "4tube.com doesn't work anymore\n## Please follow the guide below\r\n\r\n- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly\r\n- Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x])\r\n- Use *Preview* tab to see how your issue will actually look like\r\n\r\n---\r\n\r\n### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.06.12*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.\r\n- [X] I've **verified** and **I assure** that I'm running youtube-dl **2017.06.12**\r\n\r\n### Before submitting an *issue* make sure you have:\r\n- [X] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections\r\n- [X] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones\r\n\r\n### What is the purpose of your *issue*?\r\n- [X] Bug report (encountered problems with youtube-dl)\r\n- [ ] Site support request (request for adding support for a new site)\r\n- [ ] Feature request (request for a new functionality)\r\n- [ ] Question\r\n- [ ] Other\r\n\r\n---\r\n\r\n### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue*\r\n\r\n---\r\n\r\n### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows:\r\n\r\nAdd `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):\r\n```\r\n$ ./youtube-dl -v https://4tube.com/videos/432585/busty-cory-everson-loves-tit-wanking\r\n[debug] System config: []\r\n[debug] User config: []\r\n[debug] Custom config: []\r\n[debug] Command-line args: ['-v', 'https://4tube.com/videos/432585/busty-cory-everson-loves-tit-wanking']\r\n[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8\r\n[debug] youtube-dl version 2017.06.12\r\n[debug] Python version 3.6.1 - Linux-4.11.4-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.4.1\r\n[debug] exe versions: ffmpeg 3.3.2, ffprobe 3.3.2\r\n[debug] Proxy map: {}\r\n[4tube] 432585: Downloading webpage\r\n[4tube] 432585: Downloading JSON metadata\r\nERROR: Unable to download JSON metadata: <urlopen error [Errno -2] Name or service not known> (caused by URLError(gaierror(-2, 'Name or service not known'),))\r\n  File \"./youtube-dl/youtube_dl/extractor/common.py\", line 502, in _request_webpage\r\n    return self._downloader.urlopen(url_or_request)\r\n  File \"./youtube-dl/youtube_dl/YoutubeDL.py\", line 2129, in urlopen\r\n    return self._opener.open(req, timeout=self._socket_timeout)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 526, in open\r\n    response = self._open(req, data)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 544, in _open\r\n    '_open', req)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 504, in _call_chain\r\n    result = func(*args)\r\n  File \"./youtube-dl/youtube_dl/utils.py\", line 931, in http_open\r\n    req)\r\n  File \"/usr/lib64/python3.6/urllib/request.py\", line 1320, in do_open\r\n    raise URLError(err)\r\n```\r\n\r\n---\r\n\r\n### If the purpose of this *issue* is a *site support request* please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**):\r\n- Single video: https://www.youtube.com/watch?v=BaW_jenozKc\r\n- Single video: https://youtu.be/BaW_jenozKc\r\n- Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc\r\n\r\nNote that **youtube-dl does not support sites dedicated to [copyright infringement](https://github.com/rg3/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. In order for site support request to be accepted all provided example URLs should not violate any copyrights.\r\n\r\n---\r\n\r\n### Description of your *issue*, suggested solution and other information\r\n\r\nExplanation of your *issue* in arbitrary form goes here. Please make sure the [description is worded well enough to be understood](https://github.com/rg3/youtube-dl#is-the-description-of-the-issue-itself-sufficient). Provide as much context and examples as possible.\r\nIf work on your *issue* requires account credentials please provide them or explain how one can obtain them.\r\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom ..utils import (\n    parse_duration,\n    parse_iso8601,\n    sanitized_Request,\n    str_to_int,\n)\n\n\nclass FourTubeIE(InfoExtractor):\n    IE_NAME = '4tube'\n    _VALID_URL = r'https?://(?:www\\.)?4tube\\.com/videos/(?P<id>\\d+)'\n\n    _TEST = {\n        'url': 'http://www.4tube.com/videos/209733/hot-babe-holly-michaels-gets-her-ass-stuffed-by-black',\n        'md5': '6516c8ac63b03de06bc8eac14362db4f',\n        'info_dict': {\n            'id': '209733',\n            'ext': 'mp4',\n            'title': 'Hot Babe Holly Michaels gets her ass stuffed by black',\n            'uploader': 'WCP Club',\n            'uploader_id': 'wcp-club',\n            'upload_date': '20131031',\n            'timestamp': 1383263892,\n            'duration': 583,\n            'view_count': int,\n            'like_count': int,\n            'categories': list,\n            'age_limit': 18,\n        }\n    }\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n\n        title = self._html_search_meta('name', webpage)\n        timestamp = parse_iso8601(self._html_search_meta(\n            'uploadDate', webpage))\n        thumbnail = self._html_search_meta('thumbnailUrl', webpage)\n        uploader_id = self._html_search_regex(\n            r'<a class=\"item-to-subscribe\" href=\"[^\"]+/channels/([^/\"]+)\" title=\"Go to [^\"]+ page\">',\n            webpage, 'uploader id', fatal=False)\n        uploader = self._html_search_regex(\n            r'<a class=\"item-to-subscribe\" href=\"[^\"]+/channels/[^/\"]+\" title=\"Go to ([^\"]+) page\">',\n            webpage, 'uploader', fatal=False)\n\n        categories_html = self._search_regex(\n            r'(?s)><i class=\"icon icon-tag\"></i>\\s*Categories / Tags\\s*.*?<ul class=\"[^\"]*?list[^\"]*?\">(.*?)</ul>',\n            webpage, 'categories', fatal=False)\n        categories = None\n        if categories_html:\n            categories = [\n                c.strip() for c in re.findall(\n                    r'(?s)<li><a.*?>(.*?)</a>', categories_html)]\n\n        view_count = str_to_int(self._search_regex(\n            r'<meta[^>]+itemprop=\"interactionCount\"[^>]+content=\"UserPlays:([0-9,]+)\">',\n            webpage, 'view count', fatal=False))\n        like_count = str_to_int(self._search_regex(\n            r'<meta[^>]+itemprop=\"interactionCount\"[^>]+content=\"UserLikes:([0-9,]+)\">',\n            webpage, 'like count', fatal=False))\n        duration = parse_duration(self._html_search_meta('duration', webpage))\n\n        media_id = self._search_regex(\n            r'<button[^>]+data-id=([\"\\'])(?P<id>\\d+)\\1[^>]+data-quality=', webpage,\n            'media id', default=None, group='id')\n        sources = [\n            quality\n            for _, quality in re.findall(r'<button[^>]+data-quality=([\"\\'])(.+?)\\1', webpage)]\n        if not (media_id and sources):\n            player_js = self._download_webpage(\n                self._search_regex(\n                    r'<script[^>]id=([\"\\'])playerembed\\1[^>]+src=([\"\\'])(?P<url>.+?)\\2',\n                    webpage, 'player JS', group='url'),\n                video_id, 'Downloading player JS')\n            params_js = self._search_regex(\n                r'\\$\\.ajax\\(url,\\ opts\\);\\s*\\}\\s*\\}\\)\\(([0-9,\\[\\] ]+)\\)',\n                player_js, 'initialization parameters')\n            params = self._parse_json('[%s]' % params_js, video_id)\n            media_id = params[0]\n            sources = ['%s' % p for p in params[2]]\n\n        token_url = 'http://tkn.4tube.com/{0}/desktop/{1}'.format(\n            media_id, '+'.join(sources))\n        headers = {\n            b'Content-Type': b'application/x-www-form-urlencoded',\n            b'Origin': b'http://www.4tube.com',\n        }\n        token_req = sanitized_Request(token_url, b'{}', headers)\n        tokens = self._download_json(token_req, video_id)\n        formats = [{\n            'url': tokens[format]['token'],\n            'format_id': format + 'p',\n            'resolution': format + 'p',\n            'quality': int(format),\n        } for format in sources]\n        self._sort_formats(formats)\n\n        return {\n            'id': video_id,\n            'title': title,\n            'formats': formats,\n            'categories': categories,\n            'thumbnail': thumbnail,\n            'uploader': uploader,\n            'uploader_id': uploader_id,\n            'timestamp': timestamp,\n            'like_count': like_count,\n            'view_count': view_count,\n            'duration': duration,\n            'age_limit': 18,\n        }\n", "path": "youtube_dl/extractor/fourtube.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom ..utils import (\n    parse_duration,\n    parse_iso8601,\n    sanitized_Request,\n    str_to_int,\n)\n\n\nclass FourTubeIE(InfoExtractor):\n    IE_NAME = '4tube'\n    _VALID_URL = r'https?://(?:www\\.)?4tube\\.com/videos/(?P<id>\\d+)'\n\n    _TEST = {\n        'url': 'http://www.4tube.com/videos/209733/hot-babe-holly-michaels-gets-her-ass-stuffed-by-black',\n        'md5': '6516c8ac63b03de06bc8eac14362db4f',\n        'info_dict': {\n            'id': '209733',\n            'ext': 'mp4',\n            'title': 'Hot Babe Holly Michaels gets her ass stuffed by black',\n            'uploader': 'WCP Club',\n            'uploader_id': 'wcp-club',\n            'upload_date': '20131031',\n            'timestamp': 1383263892,\n            'duration': 583,\n            'view_count': int,\n            'like_count': int,\n            'categories': list,\n            'age_limit': 18,\n        }\n    }\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n\n        title = self._html_search_meta('name', webpage)\n        timestamp = parse_iso8601(self._html_search_meta(\n            'uploadDate', webpage))\n        thumbnail = self._html_search_meta('thumbnailUrl', webpage)\n        uploader_id = self._html_search_regex(\n            r'<a class=\"item-to-subscribe\" href=\"[^\"]+/channels/([^/\"]+)\" title=\"Go to [^\"]+ page\">',\n            webpage, 'uploader id', fatal=False)\n        uploader = self._html_search_regex(\n            r'<a class=\"item-to-subscribe\" href=\"[^\"]+/channels/[^/\"]+\" title=\"Go to ([^\"]+) page\">',\n            webpage, 'uploader', fatal=False)\n\n        categories_html = self._search_regex(\n            r'(?s)><i class=\"icon icon-tag\"></i>\\s*Categories / Tags\\s*.*?<ul class=\"[^\"]*?list[^\"]*?\">(.*?)</ul>',\n            webpage, 'categories', fatal=False)\n        categories = None\n        if categories_html:\n            categories = [\n                c.strip() for c in re.findall(\n                    r'(?s)<li><a.*?>(.*?)</a>', categories_html)]\n\n        view_count = str_to_int(self._search_regex(\n            r'<meta[^>]+itemprop=\"interactionCount\"[^>]+content=\"UserPlays:([0-9,]+)\">',\n            webpage, 'view count', fatal=False))\n        like_count = str_to_int(self._search_regex(\n            r'<meta[^>]+itemprop=\"interactionCount\"[^>]+content=\"UserLikes:([0-9,]+)\">',\n            webpage, 'like count', fatal=False))\n        duration = parse_duration(self._html_search_meta('duration', webpage))\n\n        media_id = self._search_regex(\n            r'<button[^>]+data-id=([\"\\'])(?P<id>\\d+)\\1[^>]+data-quality=', webpage,\n            'media id', default=None, group='id')\n        sources = [\n            quality\n            for _, quality in re.findall(r'<button[^>]+data-quality=([\"\\'])(.+?)\\1', webpage)]\n        if not (media_id and sources):\n            player_js = self._download_webpage(\n                self._search_regex(\n                    r'<script[^>]id=([\"\\'])playerembed\\1[^>]+src=([\"\\'])(?P<url>.+?)\\2',\n                    webpage, 'player JS', group='url'),\n                video_id, 'Downloading player JS')\n            params_js = self._search_regex(\n                r'\\$\\.ajax\\(url,\\ opts\\);\\s*\\}\\s*\\}\\)\\(([0-9,\\[\\] ]+)\\)',\n                player_js, 'initialization parameters')\n            params = self._parse_json('[%s]' % params_js, video_id)\n            media_id = params[0]\n            sources = ['%s' % p for p in params[2]]\n\n        token_url = 'https://tkn.kodicdn.com/{0}/desktop/{1}'.format(\n            media_id, '+'.join(sources))\n        headers = {\n            b'Content-Type': b'application/x-www-form-urlencoded',\n            b'Origin': b'https://www.4tube.com',\n        }\n        token_req = sanitized_Request(token_url, b'{}', headers)\n        tokens = self._download_json(token_req, video_id)\n        formats = [{\n            'url': tokens[format]['token'],\n            'format_id': format + 'p',\n            'resolution': format + 'p',\n            'quality': int(format),\n        } for format in sources]\n        self._sort_formats(formats)\n\n        return {\n            'id': video_id,\n            'title': title,\n            'formats': formats,\n            'categories': categories,\n            'thumbnail': thumbnail,\n            'uploader': uploader,\n            'uploader_id': uploader_id,\n            'timestamp': timestamp,\n            'like_count': like_count,\n            'view_count': view_count,\n            'duration': duration,\n            'age_limit': 18,\n        }\n", "path": "youtube_dl/extractor/fourtube.py"}]}