Skip to content

Commit

Permalink
Fixed #32
Browse files Browse the repository at this point in the history
  • Loading branch information
elmoiv authored Aug 7, 2023
1 parent dd2f211 commit ecf9dba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion redvid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
__url__ = 'https://github.com/elmoiv/redvid'
__description__ = 'Smart downloader for Reddit hosted videos'
__license__ = 'GPL-v3.0'
__version__ = '1.2.0'
__version__ = '2.0.0'
12 changes: 5 additions & 7 deletions redvid/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,18 @@ def mpdParse(mpd):
re_tags = vcfRemover(re_tags, tags)

# Filter audio tag
tag_aud = None
for tag in re_tags:
if 'audio' in tag:
tag_aud = tag
re_tags.remove(tag)
audio_tags = [tag for tag in re_tags if 'audio' in tag[1].lower()]
video_tags = list(set(re_tags) - set(audio_tags))
tag_aud = audio_tags[-1] if audio_tags else None

if not re_tags:
return 0, 0

# Allow getting qualities with old reddit method
try:
yield sorted(re_tags, key=lambda a: int(a[1]))[::-1]
yield sorted(video_tags, key=lambda a: int(a[1]))[::-1]
except:
yield sorted(re_tags, key=lambda a: a[1])[::-1]
yield sorted(video_tags, key=lambda a: a[1])[::-1]

yield tag_aud

Expand Down

0 comments on commit ecf9dba

Please sign in to comment.