mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Pull cookies from firefox
This commit is contained in:
parent
97bb88fd5c
commit
1cf5c140d6
1 changed files with 13 additions and 1 deletions
|
@ -866,10 +866,15 @@ class OtherCog(commands.Cog):
|
||||||
) = "",
|
) = "",
|
||||||
extract_audio: bool = False,
|
extract_audio: bool = False,
|
||||||
upload_log: bool = False,
|
upload_log: bool = False,
|
||||||
compress_if_possible: bool = False
|
# cookies: discord.Option(
|
||||||
|
# bool,
|
||||||
|
# description="Whether to ask for cookies.",
|
||||||
|
# default=False
|
||||||
|
# ) = False
|
||||||
):
|
):
|
||||||
"""Downloads a video using youtube-dl"""
|
"""Downloads a video using youtube-dl"""
|
||||||
await ctx.defer()
|
await ctx.defer()
|
||||||
|
compress_if_possible = False
|
||||||
formats = await self.list_formats(url)
|
formats = await self.list_formats(url)
|
||||||
if list_formats:
|
if list_formats:
|
||||||
embeds = []
|
embeds = []
|
||||||
|
@ -995,6 +1000,13 @@ class OtherCog(commands.Cog):
|
||||||
]
|
]
|
||||||
args["format"] = args["format"] or f"(ba/b)[filesize<={MAX_SIZE_MB}M]"
|
args["format"] = args["format"] or f"(ba/b)[filesize<={MAX_SIZE_MB}M]"
|
||||||
|
|
||||||
|
try:
|
||||||
|
url = urlparse(url)
|
||||||
|
if url.netloc in ("www.instagram.com", "instagram.com"):
|
||||||
|
args["cookiesfrombrowser"] = ("firefox", "default")
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
if args["format"] is None:
|
if args["format"] is None:
|
||||||
args["format"] = f"(bv*+ba/bv/ba/b)[filesize<={MAX_SIZE_MB}M]"
|
args["format"] = f"(bv*+ba/bv/ba/b)[filesize<={MAX_SIZE_MB}M]"
|
||||||
with yt_dlp.YoutubeDL(args) as downloader:
|
with yt_dlp.YoutubeDL(args) as downloader:
|
||||||
|
|
Loading…
Reference in a new issue