aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/xhamster.py
diff options
context:
space:
mode:
authorGeorge Schizas <gschizas@gmail.com>2020-08-28 11:31:29 +0300
committerGeorge Schizas <gschizas@gmail.com>2020-08-28 11:31:29 +0300
commit9f13f9d18a633eef0ba07812390e43641168676b (patch)
tree96c71b4fdc0e942c681b6a321fd1900e230cd413 /youtube_dl/extractor/xhamster.py
parentedd83104b432a971feb86c69c4963dc67cc3dfc0 (diff)
parentf5863a3ea08492bd9fc04c55e1e912d24e92d49b (diff)
downloadhypervideo-pre-9f13f9d18a633eef0ba07812390e43641168676b.tar.lz
hypervideo-pre-9f13f9d18a633eef0ba07812390e43641168676b.tar.xz
hypervideo-pre-9f13f9d18a633eef0ba07812390e43641168676b.zip
Merge branch 'master' of https://github.com/ytdl-org/youtube-dl into bugfix/youtube/chapters-fix-extractor
Diffstat (limited to 'youtube_dl/extractor/xhamster.py')
-rw-r--r--youtube_dl/extractor/xhamster.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py
index 0f7be6a7d..902a3ed33 100644
--- a/youtube_dl/extractor/xhamster.py
+++ b/youtube_dl/extractor/xhamster.py
@@ -20,13 +20,13 @@ from ..utils import (
class XHamsterIE(InfoExtractor):
- _DOMAINS = r'(?:xhamster\.(?:com|one|desi)|xhms\.pro|xhamster[27]\.com)'
+ _DOMAINS = r'(?:xhamster\.(?:com|one|desi)|xhms\.pro|xhamster\d+\.com)'
_VALID_URL = r'''(?x)
https?://
(?:.+?\.)?%s/
(?:
- movies/(?P<id>\d+)/(?P<display_id>[^/]*)\.html|
- videos/(?P<display_id_2>[^/]*)-(?P<id_2>\d+)
+ movies/(?P<id>[\dA-Za-z]+)/(?P<display_id>[^/]*)\.html|
+ videos/(?P<display_id_2>[^/]*)-(?P<id_2>[\dA-Za-z]+)
)
''' % _DOMAINS
_TESTS = [{
@@ -100,11 +100,20 @@ class XHamsterIE(InfoExtractor):
'url': 'https://xhamster2.com/videos/femaleagent-shy-beauty-takes-the-bait-1509445',
'only_matching': True,
}, {
+ 'url': 'https://xhamster11.com/videos/femaleagent-shy-beauty-takes-the-bait-1509445',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://xhamster26.com/videos/femaleagent-shy-beauty-takes-the-bait-1509445',
+ 'only_matching': True,
+ }, {
'url': 'http://xhamster.com/movies/1509445/femaleagent_shy_beauty_takes_the_bait.html',
'only_matching': True,
}, {
'url': 'http://xhamster.com/movies/2221348/britney_spears_sexy_booty.html?hd',
'only_matching': True,
+ }, {
+ 'url': 'http://de.xhamster.com/videos/skinny-girl-fucks-herself-hard-in-the-forest-xhnBJZx',
+ 'only_matching': True,
}]
def _real_extract(self, url):
@@ -129,7 +138,7 @@ class XHamsterIE(InfoExtractor):
initials = self._parse_json(
self._search_regex(
- r'window\.initials\s*=\s*({.+?})\s*;\s*\n', webpage, 'initials',
+ r'window\.initials\s*=\s*({.+?})\s*;', webpage, 'initials',
default='{}'),
video_id, fatal=False)
if initials: