Upgrade yt_dlp and download script

This commit is contained in:
2025-05-02 16:11:08 -05:00
parent 3a2e8eeb08
commit d68d9ce4f9
1194 changed files with 60099 additions and 44436 deletions

View File

@@ -1,10 +1,7 @@
import hashlib
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_get
)
from ..utils import ExtractorError, try_get
class GofileIE(InfoExtractor):
@@ -23,8 +20,8 @@ class GofileIE(InfoExtractor):
'title': 'nuuh',
'release_timestamp': 1638338704,
'release_date': '20211201',
}
}]
},
}],
}, {
'url': 'https://gofile.io/d/is8lKr',
'info_dict': {
@@ -58,21 +55,18 @@ class GofileIE(InfoExtractor):
return
account_data = self._download_json(
'https://api.gofile.io/createAccount', None, note='Getting a new guest account')
'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)
self._set_cookie('.gofile.io', 'accountToken', self._TOKEN)
def _entries(self, file_id):
query_params = {
'contentId': file_id,
'token': self._TOKEN,
'websiteToken': 12345,
}
query_params = {'wt': '4fd6sg89d7s6'} # From https://gofile.io/dist/js/alljs.js
password = self.get_param('videopassword')
if password:
query_params['password'] = hashlib.sha256(password.encode('utf-8')).hexdigest()
query_params['password'] = hashlib.sha256(password.encode()).hexdigest()
files = self._download_json(
'https://api.gofile.io/getContent', file_id, note='Getting filelist', query=query_params)
f'https://api.gofile.io/contents/{file_id}', file_id, 'Getting filelist',
query=query_params, headers={'Authorization': f'Bearer {self._TOKEN}'})
status = files['status']
if status == 'error-passwordRequired':
@@ -82,7 +76,7 @@ class GofileIE(InfoExtractor):
raise ExtractorError(f'{self.IE_NAME} said: status {status}', expected=True)
found_files = False
for file in (try_get(files, lambda x: x['data']['contents'], dict) or {}).values():
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
@@ -95,7 +89,7 @@ class GofileIE(InfoExtractor):
'title': file['name'].rsplit('.', 1)[0],
'url': file_url,
'filesize': file.get('size'),
'release_timestamp': file.get('createTime')
'release_timestamp': file.get('createTime'),
}
if not found_files: