A feature-rich command-line audio/video downloader
[ie/unsupported] Update unsupported sites (#17085)
bashonly5678b282e2a1
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.pyindex 3de3561a75..2aed7ceb38 100644--- a/yt_dlp/extractor/_extractors.py+++ b/yt_dlp/extractor/_extractors.py@@ -691,7 +691,6 @@ from .gmanetwork import GMANetworkVideoIEfrom .go import GoIEfrom .godresource import GodResourceIEfrom .godtube import GodTubeIE-from .gofile import GofileIEfrom .golem import GolemIEfrom .goodgame import GoodGameIEfrom .googledrive import (@@ -2120,6 +2119,7 @@ from .unitednations import UnitedNationsWebTvIEfrom .unity import UnityIEfrom .unsupported import (KnownDRMIE,+ KnownLiabilityIE,KnownPiracyIE,)from .uol import UOLIEdiff --git a/yt_dlp/extractor/gofile.py b/yt_dlp/extractor/gofile.pydeleted file mode 100644index e2144d7eca..0000000000--- a/yt_dlp/extractor/gofile.py+++ /dev/null@@ -1,104 +0,0 @@-import hashlib--from .common import InfoExtractor-from ..utils import ExtractorError, try_get---class GofileIE(InfoExtractor):- _VALID_URL = r'https?://(?:www\.)?gofile\.io/d/(?P<id>[^/]+)'- _TESTS = [{- 'url': 'https://gofile.io/d/AMZyDw',- 'info_dict': {- 'id': 'AMZyDw',- },- 'playlist_mincount': 2,- 'playlist': [{- 'info_dict': {- 'id': 'de571ac1-5edc-42e2-8ec2-bdac83ad4a31',- 'filesize': 928116,- 'ext': 'mp4',- 'title': 'nuuh',- 'release_timestamp': 1638338704,- 'release_date': '20211201',- },- }],- }, {- 'url': 'https://gofile.io/d/is8lKr',- 'info_dict': {- 'id': 'TMjXd9',- 'ext': 'mp4',- },- 'playlist_count': 0,- 'skip': 'No video/audio found at provided URL.',- }, {- 'url': 'https://gofile.io/d/TMjXd9',- 'info_dict': {- 'id': 'TMjXd9',- },- 'playlist_count': 1,- }, {- 'url': 'https://gofile.io/d/gqOtRf',- 'info_dict': {- 'id': 'gqOtRf',- },- 'playlist_mincount': 1,- 'params': {- 'videopassword': 'password',- },- }]- _STATIC_TOKEN = '4fd6sg89d7s6' # From https://gofile.io/dist/js/config.js- _TOKEN = None-- def _real_initialize(self):- token = self._get_cookies('https://gofile.io/').get('accountToken')- if token:- self._TOKEN = token.value- return-- account_data = self._download_json(- 'https://api.gofile.io/accounts', None, 'Getting a new guest account', data=b'{}')- self._TOKEN = account_data['data']['token']- self._set_cookie('.gofile.io', 'accountToken', self._TOKEN)-- def _entries(self, file_id):- query_params = {}- if password := self.get_param('videopassword'):- query_params['password'] = hashlib.sha256(password.encode()).hexdigest()-- files = self._download_json(- f'https://api.gofile.io/contents/{file_id}', file_id, 'Getting filelist',- query=query_params, headers={- 'Authorization': f'Bearer {self._TOKEN}',- 'X-Website-Token': self._STATIC_TOKEN,- })-- status = files['status']- if status == 'error-passwordRequired':- raise ExtractorError(- 'This video is protected by a password, use the --video-password option', expected=True)- elif status != 'ok':- raise ExtractorError(f'{self.IE_NAME} said: status {status}', expected=True)-- found_files = False- for file in (try_get(files, lambda x: x['data']['children'], dict) or {}).values():- file_type, file_format = file.get('mimetype').split('/', 1)- if file_type not in ('video', 'audio') and file_format != 'vnd.mts':- continue-- found_files = True- file_url = file.get('link')- if file_url:- yield {- 'id': file['id'],- 'title': file['name'].rsplit('.', 1)[0],- 'url': file_url,- 'filesize': file.get('size'),- 'release_timestamp': file.get('createTime'),- }-- if not found_files:- raise ExtractorError('No video/audio found at provided URL.', expected=True)-- def _real_extract(self, url):- file_id = self._match_id(url)- return self.playlist_result(self._entries(file_id), playlist_id=file_id)diff --git a/yt_dlp/extractor/unsupported.py b/yt_dlp/extractor/unsupported.pyindex 5d965ec3a2..5f353c1fde 100644--- a/yt_dlp/extractor/unsupported.py+++ b/yt_dlp/extractor/unsupported.py@@ -303,6 +303,7 @@ class KnownPiracyIE(UnsupportedInfoExtractor):r'xanimu\.com',r'musicdex\.org',r'duboku\.io',+ r'gofile\.io',)_TESTS = [{@@ -311,9 +312,42 @@ class KnownPiracyIE(UnsupportedInfoExtractor):}, {'url': 'https://thisav.com/en/terms','only_matching': True,+ }, {+ 'url': 'https://gofile.io/d/',+ 'only_matching': True,}]def _real_extract(self, url):raise ExtractorError(f'This website is no longer supported since it has been determined to be primarily used for piracy.{LF}'f'{self._downloader._format_err("DO NOT", self._downloader.Styles.ERROR)} open issues for it', expected=True)+++class KnownLiabilityIE(UnsupportedInfoExtractor):+ """Sites that would be a liability to the project if supported++ In order for this to not end up being a catalog of sketchy sites,+ only sites that were once supported should be added to this list+ """++ URLS = (+ r'motherless\.com',+ r'suno\.com',+ r'udio\.com',+ )++ _TESTS = [{+ 'url': 'https://motherless.com/',+ 'only_matching': True,+ }, {+ 'url': 'https://suno.com/song/',+ 'only_matching': True,+ }, {+ 'url': 'https://www.udio.com/songs/',+ 'only_matching': True,+ }]++ def _real_extract(self, url):+ raise ExtractorError(+ f'This website is not supported and will not be supported.{LF}'+ f'{self._downloader._format_err("DO NOT", self._downloader.Styles.ERROR)} open issues for it', expected=True)