Compare commits

..

No commits in common. "c043c246251da815c99f8c779194fcdef9ef7a58" and "c800598cd1a3467e53b479c5efc8c6d603d94e5c" have entirely different histories.

5 changed files with 12 additions and 60 deletions

View File

@ -563,7 +563,6 @@ from .funimation import (
)
from .funk import FunkIE
from .fusion import FusionIE
from .fuyintv import FuyinTVIE
from .gab import (
GabTVIE,
GabIE,

View File

@ -730,14 +730,14 @@ class InfoExtractor:
else:
return err.code in variadic(expected_status)
def _create_request(self, url_or_request, data=None, headers=None, query=None):
def _create_request(self, url_or_request, data=None, headers={}, query={}):
if isinstance(url_or_request, urllib.request.Request):
return update_Request(url_or_request, data=data, headers=headers, query=query)
if query:
url_or_request = update_url_query(url_or_request, query)
return sanitized_Request(url_or_request, data, headers or {})
return sanitized_Request(url_or_request, data, headers)
def _request_webpage(self, url_or_request, video_id, note=None, errnote=None, fatal=True, data=None, headers=None, query=None, expected_status=None):
def _request_webpage(self, url_or_request, video_id, note=None, errnote=None, fatal=True, data=None, headers={}, query={}, expected_status=None):
"""
Return the response handle.
@ -765,8 +765,8 @@ class InfoExtractor:
# geo unrestricted country. We will do so once we encounter any
# geo restriction error.
if self._x_forwarded_for_ip:
headers = (headers or {}).copy()
headers.setdefault('X-Forwarded-For', self._x_forwarded_for_ip)
if 'X-Forwarded-For' not in headers:
headers['X-Forwarded-For'] = self._x_forwarded_for_ip
try:
return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))

View File

@ -1,30 +0,0 @@
from .common import InfoExtractor
from ..utils import traverse_obj
class FuyinTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?fuyin\.tv/html/(?:\d+)/(?P<id>\d+)\.html'
_TESTS = [{
'url': 'https://www.fuyin.tv/html/2733/44129.html',
'info_dict': {
'id': '44129',
'ext': 'mp4',
'title': '第1集',
'description': 'md5:21a3d238dc8d49608e1308e85044b9c3',
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
json_data = self._download_json(
'https://www.fuyin.tv/api/api/tv.movie/url',
video_id, query={'urlid': f'{video_id}'})
webpage = self._download_webpage(url, video_id, fatal=False)
return {
'id': video_id,
'title': traverse_obj(json_data, ('data', 'title')),
'url': json_data['data']['url'],
'ext': 'mp4',
'description': self._html_search_meta('description', webpage),
}

View File

@ -6,18 +6,14 @@ from ..utils import ExtractorError
class VideocampusSachsenIE(InfoExtractor):
IE_NAME = 'ViMP'
IE_NAME = 'Vimp'
_INSTANCES = (
'bergauf.tv',
'campus.demo.vimp.com',
'corporate.demo.vimp.com',
'dancehalldatabase.com',
'drehzahl.tv',
'educhannel.hs-gesundheit.de',
'emedia.ls.haw-hamburg.de',
'globale-evolution.net',
'hohu.tv',
'htvideos.hightechhigh.org',
'k210039.vimp.mivitec.net',
'media.cmslegal.com',
'media.hs-furtwangen.de',
@ -29,7 +25,6 @@ class VideocampusSachsenIE(InfoExtractor):
'mportal.europa-uni.de',
'pacific.demo.vimp.com',
'slctv.com',
'streaming.prairiesouth.ca',
'tube.isbonline.cn',
'univideo.uni-kassel.de',
'ursula2.genetics.emory.edu',
@ -57,15 +52,11 @@ class VideocampusSachsenIE(InfoExtractor):
'vimp.weka-fachmedien.de',
'webtv.univ-montp3.fr',
'www.b-tu.de/media',
'www.bergauf.tv',
'www.bigcitytv.de',
'www.cad-videos.de',
'www.drehzahl.tv',
'www.fh-bielefeld.de/medienportal',
'www.hohu.tv',
'www.orvovideo.com',
'www.rwe.tv',
'www.salzi.tv',
'www.wenglor-media.com',
'www2.univ-sba.dz',
)
@ -82,7 +73,6 @@ class VideocampusSachsenIE(InfoExtractor):
'id': 'e6b9349905c1628631f175712250f2a1',
'title': 'Konstruktiver Entwicklungsprozess Vorlesung 7',
'description': 'Konstruktiver Entwicklungsprozess Vorlesung 7',
'thumbnail': 'https://videocampus.sachsen.de/cache/1a985379ad3aecba8097a6902c7daa4e.jpg',
'ext': 'mp4',
},
},
@ -92,7 +82,6 @@ class VideocampusSachsenIE(InfoExtractor):
'id': 'fc99c527e4205b121cb7c74433469262',
'title': 'Was ist selbstgesteuertes Lernen?',
'description': 'md5:196aa3b0509a526db62f84679522a2f5',
'thumbnail': 'https://videocampus.sachsen.de/cache/6f4a85096ba24cb398e6ce54446b57ae.jpg',
'display_id': 'Was-ist-selbstgesteuertes-Lernen',
'ext': 'mp4',
},
@ -103,7 +92,6 @@ class VideocampusSachsenIE(InfoExtractor):
'id': '09d4ed029002eb1bdda610f1103dd54c',
'title': 'Tutorial zur Nutzung von Adobe Connect aus Veranstalter-Sicht',
'description': 'md5:3d379ca3cc17b9da6784d7f58cca4d58',
'thumbnail': 'https://videocampus.sachsen.de/cache/2452498fe8c2d5a7dc79a05d30f407b6.jpg',
'display_id': 'Tutorial-zur-Nutzung-von-Adobe-Connect-aus-Veranstalter-Sicht',
'ext': 'mp4',
},
@ -115,7 +103,6 @@ class VideocampusSachsenIE(InfoExtractor):
'id': '0183356e41af7bfb83d7667b20d9b6a3',
'title': 'Présentation de la Faculté de droit et des sciences politiques - Journée portes ouvertes 2021/22',
'description': 'md5:508958bd93e0ca002ac731d94182a54f',
'thumbnail': 'https://www2.univ-sba.dz/cache/4d5d4a0b4189271a8cc6cb5328e14769.jpg',
'display_id': 'Presentation-de-la-Faculte-de-droit-et-des-sciences-politiques-Journee-portes-ouvertes-202122',
'ext': 'mp4',
}
@ -126,7 +113,6 @@ class VideocampusSachsenIE(InfoExtractor):
'id': 'c8816f1cc942c12b6cce57c835cffd7c',
'title': 'Preisverleihung »Produkte des Jahres 2022«',
'description': 'md5:60c347568ca89aa25b772c4ea564ebd3',
'thumbnail': 'https://vimp.weka-fachmedien.de/cache/da9f3090e9227b25beacf67ccf94de14.png',
'display_id': 'Preisverleihung-Produkte-des-Jahres-2022',
'ext': 'mp4',
},
@ -138,7 +124,7 @@ class VideocampusSachsenIE(InfoExtractor):
'title': 'Was ist selbstgesteuertes Lernen?',
'ext': 'mp4',
},
},
}
]
def _real_extract(self, url):
@ -153,14 +139,12 @@ class VideocampusSachsenIE(InfoExtractor):
if not (display_id or tmp_id):
# Title, description from embedded page's meta wouldn't be correct
title = self._html_search_regex(r'<video-js[^>]* data-piwik-title="([^"<]+)"', webpage, 'title', fatal=False)
title = self._html_search_regex(r'<img[^>]* title="([^"<]+)"', webpage, 'title', fatal=False)
description = None
thumbnail = None
else:
title = self._html_search_meta(('og:title', 'twitter:title', 'title'), webpage, fatal=False)
description = self._html_search_meta(
('og:description', 'twitter:description', 'description'), webpage, fatal=False)
thumbnail = self._html_search_meta(('og:image', 'twitter:image'), webpage, fatal=False)
('og:description', 'twitter:description', 'description'), webpage, default=None)
formats, subtitles = [], {}
try:
@ -178,8 +162,7 @@ class VideocampusSachsenIE(InfoExtractor):
'id': video_id,
'title': title,
'description': description,
'thumbnail': thumbnail,
'display_id': display_id,
'formats': formats,
'subtitles': subtitles,
'subtitles': subtitles
}

View File

@ -3015,9 +3015,9 @@ def update_url_query(url, query):
query=urllib.parse.urlencode(qs, True)))
def update_Request(req, url=None, data=None, headers=None, query=None):
def update_Request(req, url=None, data=None, headers={}, query={}):
req_headers = req.headers.copy()
req_headers.update(headers or {})
req_headers.update(headers)
req_data = data or req.data
req_url = update_url_query(url or req.get_full_url(), query)
req_get_method = req.get_method()