Skip to content

Commit

Permalink
Filter urls to be more palatable
Browse files Browse the repository at this point in the history
  • Loading branch information
mreweilk committed Sep 29, 2017
1 parent 2928748 commit eae7f43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import collections
import re
from urllib.parse import urlparse

# https://stackoverflow.com/a/18394648/975018
Expand Down Expand Up @@ -41,6 +42,8 @@ def parse_media_option(mo):
opts = []
for m in mo:
if m.startswith('http'):
m = re.sub(r'tidal.com\/.{2}\/store\/','tidal.com/',m)
m = re.sub(r'tidal.com\/store\/','tidal.com/',m)
url = urlparse(m)
components = url.path.split('/')
if not components or len(components) <= 2:
Expand Down

0 comments on commit eae7f43

Please sign in to comment.