Skip to content

Commit

Permalink
no playlist when ytinfo
Browse files Browse the repository at this point in the history
Signed-off-by: Udith <[email protected]>
  • Loading branch information
uaudith committed Apr 25, 2020
1 parent 25e1bd2 commit 4fd1bbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions userge/plugins/utils/utube.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

def yt_getInfo(link):
try:
x = ytdl.YoutubeDL().extract_info(link, download=False)
x = ytdl.YoutubeDL({'no-playlist': True}).extract_info(link, download=False)
thumb = x.get('thumbnail', '')
formats = x.get('formats', [x])
out = "No formats found :("
if formats:
out = "--U-ID | Reso. | Extension--\n"
for i in formats:
out += f"`{i['format_id']} | {i.get('format_note', None)} | {i.get('ext', None)}`\n"
out += f"`{i.get('format_id','')} | {i.get('format_note', None)} | {i.get('ext', None)}`\n"
except ytdl.utils.YoutubeDLError as e:
return e
else:
Expand Down
10 changes: 5 additions & 5 deletions userge/utils/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ async def progress(current: int,
humanbytes(total),
humanbytes(speed),
time_to_completion if time_to_completion else "0 s")
if message.text != progress_str:
try:
await message.edit(progress_str)

try:
await message.try_to_edit(progress_str)

except FloodWait as f_e:
time.sleep(f_e.x)
except FloodWait as f_e:
time.sleep(f_e.x)

0 comments on commit 4fd1bbf

Please sign in to comment.