aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcntrl-s <65956966+cntrl-s@users.noreply.github.com>2021-11-27 00:05:39 +0530
committerGitHub <noreply@github.com>2021-11-27 00:05:39 +0530
commit883ecd54949fa90174094628bf002f179edf6767 (patch)
tree9328c9a2cb215d9ee078efca7f67a7bf6024dbab
parenteb56d132d21752fa50e0dd2c3bfa3d983ad48655 (diff)
downloadhypervideo-pre-883ecd54949fa90174094628bf002f179edf6767.tar.lz
hypervideo-pre-883ecd54949fa90174094628bf002f179edf6767.tar.xz
hypervideo-pre-883ecd54949fa90174094628bf002f179edf6767.zip
Streamff extractor (#1736)
Closes #1359 Authored by: cntrl-s
-rw-r--r--yt_dlp/extractor/extractors.py1
-rw-r--r--yt_dlp/extractor/streamff.py31
2 files changed, 32 insertions, 0 deletions
diff --git a/yt_dlp/extractor/extractors.py b/yt_dlp/extractor/extractors.py
index 4dda3705a..163efc748 100644
--- a/yt_dlp/extractor/extractors.py
+++ b/yt_dlp/extractor/extractors.py
@@ -1404,6 +1404,7 @@ from .streamable import StreamableIE
from .streamanity import StreamanityIE
from .streamcloud import StreamcloudIE
from .streamcz import StreamCZIE
+from .streamff import StreamFFIE
from .streetvoice import StreetVoiceIE
from .stretchinternet import StretchInternetIE
from .stripchat import StripchatIE
diff --git a/yt_dlp/extractor/streamff.py b/yt_dlp/extractor/streamff.py
new file mode 100644
index 000000000..6b190bb3b
--- /dev/null
+++ b/yt_dlp/extractor/streamff.py
@@ -0,0 +1,31 @@
+# coding: utf-8
+from .common import InfoExtractor
+from ..utils import int_or_none, parse_iso8601
+
+
+class StreamFFIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?streamff\.com/v/(?P<id>[a-zA-Z0-9]+)'
+
+ _TESTS = [{
+ 'url': 'https://streamff.com/v/55cc94',
+ 'md5': '8745a67bb5e5c570738efe7983826370',
+ 'info_dict': {
+ 'id': '55cc94',
+ 'ext': 'mp4',
+ 'title': '55cc94',
+ 'timestamp': 1634764643,
+ 'upload_date': '20211020',
+ 'view_count': int,
+ }
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ json_data = self._download_json(f'https://streamff.com/api/videos/{video_id}', video_id)
+ return {
+ 'id': video_id,
+ 'title': json_data.get('name') or video_id,
+ 'url': 'https://streamff.com/%s' % json_data['videoLink'],
+ 'view_count': int_or_none(json_data.get('views')),
+ 'timestamp': parse_iso8601(json_data.get('date')),
+ }