summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/dropbox.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:10 +0000
commit137f07c27a88b07df57df5b2cdebebe3c7722bac (patch)
tree4ebdcbea6b540f69c40ba0be6ac766008030d149 /yt_dlp/extractor/dropbox.py
parentAdding debian version 2024.05.27-1. (diff)
downloadyt-dlp-137f07c27a88b07df57df5b2cdebebe3c7722bac.tar.xz
yt-dlp-137f07c27a88b07df57df5b2cdebebe3c7722bac.zip
Merging upstream version 2024.07.01.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/dropbox.py')
-rw-r--r--yt_dlp/extractor/dropbox.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/yt_dlp/extractor/dropbox.py b/yt_dlp/extractor/dropbox.py
index 0246975..51b40df 100644
--- a/yt_dlp/extractor/dropbox.py
+++ b/yt_dlp/extractor/dropbox.py
@@ -1,9 +1,9 @@
import base64
import os.path
import re
+import urllib.parse
from .common import InfoExtractor
-from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
update_url_query,
@@ -19,8 +19,8 @@ class DropboxIE(InfoExtractor):
'info_dict': {
'id': 'nelirfsxnmcfbfh',
'ext': 'mp4',
- 'title': 'youtube-dl test video \'ä"BaW_jenozKc'
- }
+ 'title': 'youtube-dl test video \'ä"BaW_jenozKc',
+ },
}, {
'url': 'https://www.dropbox.com/s/nelirfsxnmcfbfh',
'only_matching': True,
@@ -40,7 +40,7 @@ class DropboxIE(InfoExtractor):
mobj = self._match_valid_url(url)
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
- fn = compat_urllib_parse_unquote(url_basename(url))
+ fn = urllib.parse.unquote(url_basename(url))
title = os.path.splitext(fn)[0]
password = self.get_param('videopassword')
@@ -51,7 +51,7 @@ class DropboxIE(InfoExtractor):
content_id = self._search_regex(r'content_id=(.*?)["\']', webpage, 'content_id')
payload = f'is_xhr=true&t={self._get_cookies("https://www.dropbox.com").get("t").value}&content_id={content_id}&password={password}&url={url}'
response = self._download_json(
- 'https://www.dropbox.com/sm/auth', video_id, 'POSTing video password', data=payload.encode('UTF-8'),
+ 'https://www.dropbox.com/sm/auth', video_id, 'POSTing video password', data=payload.encode(),
headers={'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'})
if response.get('status') != 'authed':
@@ -81,12 +81,12 @@ class DropboxIE(InfoExtractor):
'url': update_url_query(url, {'dl': '1'}),
'format_id': 'original',
'format_note': 'Original',
- 'quality': 1
+ 'quality': 1,
})
return {
'id': video_id,
'title': title,
'formats': formats,
- 'subtitles': subtitles
+ 'subtitles': subtitles,
}