mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2025-02-25 15:54:09 +08:00
Always use the source
format for Google Drive URLs (#300)
Always using the `source` format for Google Drive URLs will ensure getting original file, without any modifications.
This commit is contained in:
parent
82ba992a84
commit
6bce8b92dc
1 changed files with 11 additions and 6 deletions
|
@ -169,12 +169,17 @@ def ytdl_download(url: str, tempdir: str, bm, **kwargs) -> list:
|
||||||
"--max-concurrent-downloads=16",
|
"--max-concurrent-downloads=16",
|
||||||
"--split=16",
|
"--split=16",
|
||||||
]
|
]
|
||||||
formats = [
|
if url.startswith("https://drive.google.com"):
|
||||||
# webm , vp9 and av01 are not streamable on telegram, so we'll extract mp4 and not av01 codec
|
# Always use the `source` format for Google Drive URLs.
|
||||||
"bestvideo[ext=mp4][vcodec!*=av01][vcodec!*=vp09]+bestaudio[ext=m4a]/bestvideo+bestaudio",
|
formats = ["source"]
|
||||||
"bestvideo[vcodec^=avc]+bestaudio[acodec^=mp4a]/best[vcodec^=avc]/best",
|
else:
|
||||||
None,
|
# Use the default formats for other URLs.
|
||||||
]
|
formats = [
|
||||||
|
# webm , vp9 and av01 are not streamable on telegram, so we'll extract only mp4
|
||||||
|
"bestvideo[ext=mp4][vcodec!*=av01][vcodec!*=vp09]+bestaudio[ext=m4a]/bestvideo+bestaudio",
|
||||||
|
"bestvideo[vcodec^=avc]+bestaudio[acodec^=mp4a]/best[vcodec^=avc]/best",
|
||||||
|
None,
|
||||||
|
]
|
||||||
adjust_formats(chat_id, url, formats, hijack)
|
adjust_formats(chat_id, url, formats, hijack)
|
||||||
if download_instagram(url, tempdir):
|
if download_instagram(url, tempdir):
|
||||||
return list(pathlib.Path(tempdir).glob("*"))
|
return list(pathlib.Path(tempdir).glob("*"))
|
||||||
|
|
Loading…
Reference in a new issue