Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from yt_dlp.extractor.common import InfoExtractor
- from datetime import datetime
- class PomfIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?pomf\.tv/streamhistory/(?P<uploader>[^/]+)/(?P<id>[0-9]+)'
- def _real_extract(self, url):
- match = self._match_valid_url(url)
- video_id = match.group('id')
- uploader = match.group('uploader')
- vods = self._download_json(f"https://pomf.tv/api/history/getuserhistory.php?user={uploader}", video_id)
- vod = vods.get(video_id)
- video_url = vod.get('raw_url')
- timestamp = int(datetime.strptime(vod.get('date'), "%Y-%m-%d %H:%M:%S").timestamp())
- return {
- 'id': video_id,
- 'title': vod.get('stream_title'),
- 'uploader': uploader,
- 'thumbnail': f"https:{video_url}.png",
- 'url': f"https:{video_url}",
- 'timestamp': timestamp
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement