From 6990899c55bb39b1b0beacbcc24f6cce8433db96 Mon Sep 17 00:00:00 2001
From: Pip Longrun <pip.longrun@protonmail.com>
Date: Thu, 26 Dec 2019 16:32:31 +0100
Subject: [PATCH] [JizzBunker] Add new extractor

---
 youtube_dl/extractor/extractors.py |  1 +
 youtube_dl/extractor/jizzbunker.py | 43 ++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 youtube_dl/extractor/jizzbunker.py

diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py
index 376d07727..05410bd20 100644
--- a/youtube_dl/extractor/extractors.py
+++ b/youtube_dl/extractor/extractors.py
@@ -494,6 +494,7 @@ from .jamendo import (
     JamendoAlbumIE,
 )
 from .jeuxvideo import JeuxVideoIE
+from .jizzbunker import JizzBunkerIE
 from .jove import JoveIE
 from .joj import JojIE
 from .jwplatform import JWPlatformIE
diff --git a/youtube_dl/extractor/jizzbunker.py b/youtube_dl/extractor/jizzbunker.py
new file mode 100644
index 000000000..1bc359517
--- /dev/null
+++ b/youtube_dl/extractor/jizzbunker.py
@@ -0,0 +1,43 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+    int_or_none,
+)
+
+
+class JizzBunkerIE(InfoExtractor):
+    _VALID_URL = r'https://(?:www\.)?jizzbunker\.com/(?P<id>\d+)/(?P<display_id>.+)\.html'
+    _TEST = {
+        'url': 'https://jizzbunker.com/22295/blonde-girl-strips-at-home.html',
+        'info_dict': {
+            'id': '22295',
+            'display_id': 'blonde-girl-strips-at-home',
+            'ext': '480',
+            'title': 'Blonde girl strips at home',
+            'thumbnail': r're:^https?://.*\.jpg$',
+        }
+    }
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        display_id = re.match(self._VALID_URL, url).group('display_id')
+
+        webpage = self._download_webpage(url, video_id)
+
+        title = self._html_search_regex(r'<h1[^>]*>\n?(.+?)</h1>', webpage, 'title')
+        thumbnail = self._og_search_thumbnail(webpage, default=None)
+        duration = int_or_none(self._search_regex(r'dur: (\d+)', webpage, 'duration', default=None))
+        video_url = self._search_regex(r"type:'video/mp4',src:'(https://[^']+)", webpage, 'video url')
+
+        return {
+            'id': video_id,
+            'display_id': display_id,
+            'title': title,
+            'thumbnail': thumbnail,
+            'duration': duration,
+            'url': video_url,
+        }