mirror of https://github.com/yt-dlp/yt-dlp.git
Compare commits
4 Commits
4304bac272
...
c7a1260a8a
Author | SHA1 | Date |
---|---|---|
rasmus | c7a1260a8a | |
rasmus | 7027b79160 | |
rasmus | 6bb3679217 | |
pukkandan | e4a9322c48 |
|
@ -1,5 +1,5 @@
|
|||
import json
|
||||
import urllib
|
||||
import urllib.parse
|
||||
|
||||
from .common import InfoExtractor
|
||||
from .youtube import YoutubeIE
|
||||
|
@ -9,6 +9,7 @@
|
|||
qualities,
|
||||
str_or_none,
|
||||
url_or_none,
|
||||
bug_reports_message,
|
||||
)
|
||||
from ..utils.traversal import traverse_obj
|
||||
|
||||
|
@ -173,7 +174,7 @@ def _real_extract(self, url):
|
|||
auth_data = json.loads(urllib.parse.unquote(auth_cookie.value))
|
||||
auth_headers['Authorization'] = f'Bearer {auth_data["accessToken"]}'
|
||||
except (json.JSONDecodeError, KeyError):
|
||||
self.report_warning('Failed to extract token from auth cookie.')
|
||||
self.report_warning(f'Failed to extract token from auth cookie{bug_reports_message()}')
|
||||
|
||||
post = self._download_json(
|
||||
f'https://api.boosty.to/v1/blog/{user}/post/{post_id}', post_id,
|
||||
|
@ -215,9 +216,9 @@ def _real_extract(self, url):
|
|||
'thumbnail': (('previewUrl', 'defaultPreview'), {url_or_none}),
|
||||
}, get_all=False)})
|
||||
|
||||
if not post.get('hasAccess'):
|
||||
self.raise_login_required('This post requires a subscription', True, method='cookies')
|
||||
if not entries:
|
||||
if not entries and not post.get('hasAccess'):
|
||||
self.raise_login_required('This post requires a subscription', metadata_available=True)
|
||||
elif not entries:
|
||||
raise ExtractorError('No videos found', expected=True)
|
||||
if len(entries) == 1:
|
||||
return entries[0]
|
||||
|
|
Loading…
Reference in New Issue