summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/streamff.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:37:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:37:42 +0000
commitc7bab7c39fd51c0812f70020172766303191bc01 (patch)
tree56c05fbdd4fc47409d48ba318a4b621a7b0d299a /yt_dlp/extractor/streamff.py
parentInitial commit. (diff)
downloadyt-dlp-c7bab7c39fd51c0812f70020172766303191bc01.tar.xz
yt-dlp-c7bab7c39fd51c0812f70020172766303191bc01.zip
Adding upstream version 2023.03.04.upstream/2023.03.04upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/streamff.py')
-rw-r--r--yt_dlp/extractor/streamff.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/yt_dlp/extractor/streamff.py b/yt_dlp/extractor/streamff.py
new file mode 100644
index 0000000..93c4294
--- /dev/null
+++ b/yt_dlp/extractor/streamff.py
@@ -0,0 +1,30 @@
+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')),
+ }