Skip to content

Commit

Permalink
Fixed #39
Browse files Browse the repository at this point in the history
  • Loading branch information
elmoiv committed Mar 4, 2024
1 parent ada496c commit 92b93f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ venv.bak/

# mypy
.mypy_cache/
.upload_to_pypi.bat
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__ = '2.0.3'
__version__ = '2.0.4'
5 changes: 3 additions & 2 deletions redvid/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ def vcfRemover(BaseUrls, rgx):
def mpdParse(mpd):
# v2.0.1: Fix for new reddit mechanism
tags = r'<BaseURL>(DASH_)(?!vtt)(.*?)(\.mp4)?</BaseURL>'
re_tags = re.findall(tags, mpd)
tags_a = r'<BaseURL>(audio)(\.mp4)?</BaseURL>'
re_tags = re.findall(tags, mpd) + re.findall(tags_a, mpd)

# v1.1.1: Fix Base Urls from vcf.redd.it
if any('vcf.redd.it' in j(i) for i in re_tags):
re_tags = vcfRemover(re_tags, tags)

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

Expand Down

0 comments on commit 92b93f8

Please sign in to comment.