mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-29 11:44:33 +01:00
[FiteTV] Add new extractor
This commit is contained in:
parent
00eb865b3c
commit
931a87cec7
@ -348,6 +348,7 @@ from .filmon import (
|
||||
)
|
||||
from .filmweb import FilmwebIE
|
||||
from .firsttv import FirstTVIE
|
||||
from .fitetv import FiteTVIE
|
||||
from .fivemin import FiveMinIE
|
||||
from .fivetv import FiveTVIE
|
||||
from .flickr import FlickrIE
|
||||
|
51
youtube_dl/extractor/fitetv.py
Normal file
51
youtube_dl/extractor/fitetv.py
Normal file
@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
|
||||
|
||||
class FiteTVIE(InfoExtractor):
|
||||
_VALID_URL = r"https?://(?:www\.)?fite\.tv/watch/(?:.+)/(?P<id>.+)/"
|
||||
_TESTS = [
|
||||
{
|
||||
"url": "https://www.fite.tv/watch/all-out-press-conference-weigh-ins/2ozok/",
|
||||
"md5": "60986200ae3ed52bfb990611583e0d03",
|
||||
"info_dict": {
|
||||
"id": "2ozok",
|
||||
"ext": "mp4",
|
||||
"title": "ALL OUT Press Conference & Weigh In",
|
||||
"description": "Official Free Replay: ✓ All Elite Wrestling ✓ Pro Wrestling, Events, Press Conferences ✓ LIVE Aug 29, 8PM ET/5PM PT ✓ Jenn Decker ✓ Hyatt Regency Schaumburg ✓ 1800 E Golf Rd, Schaumburg, IL 60173, USA ✓ You must watch ALL OUT Press Conference & Weigh Ins hosted by Jenn Decker!",
|
||||
"thumbnail": r"re:^https?://.*\.jpg$",
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
json_ld = self._parse_json(
|
||||
self._search_regex(
|
||||
r'(?s)<script[^>]+type=(["\'])application/ld\+json\1[^>]*>(?P<json_ld>[^<]+VideoObject[^<]+)</script>',
|
||||
webpage,
|
||||
"json_ld",
|
||||
group="json_ld",
|
||||
),
|
||||
video_id,
|
||||
)
|
||||
|
||||
info_dict = self._json_ld(json_ld, video_id)
|
||||
|
||||
formats = self._extract_m3u8_formats(
|
||||
"https://www.fite.tv/embed/play/%s.m3u8?" % video_id, video_id, "mp4"
|
||||
)
|
||||
|
||||
self._sort_formats(formats)
|
||||
|
||||
return {
|
||||
"id": video_id,
|
||||
"title": info_dict["title"],
|
||||
"description": info_dict["description"],
|
||||
"thumbnail": info_dict["thumbnail"],
|
||||
"formats": formats,
|
||||
}
|
Loading…
Reference in New Issue
Block a user