diff options
author | pukkandan <pukkandan@gmail.com> | 2021-01-08 21:44:50 +0530 |
---|---|---|
committer | pukkandan <pukkandan@gmail.com> | 2021-01-08 21:59:10 +0530 |
commit | 00dd0cd573c6ef8ca38dc73b88160b6c9f074dbe (patch) | |
tree | 7a7c1f5587556df9ccbb981eed745567dfba86a0 /youtube_dlc/utils.py | |
parent | 0c0ff18f7d9087c8306a8ad8713aef409a7f63f8 (diff) | |
download | hypervideo-pre-00dd0cd573c6ef8ca38dc73b88160b6c9f074dbe.tar.lz hypervideo-pre-00dd0cd573c6ef8ca38dc73b88160b6c9f074dbe.tar.xz hypervideo-pre-00dd0cd573c6ef8ca38dc73b88160b6c9f074dbe.zip |
Update to ytdl-2021.01.08
Diffstat (limited to 'youtube_dlc/utils.py')
-rw-r--r-- | youtube_dlc/utils.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/youtube_dlc/utils.py b/youtube_dlc/utils.py index 6a04b710e..586ad4150 100644 --- a/youtube_dlc/utils.py +++ b/youtube_dlc/utils.py @@ -5819,3 +5819,20 @@ def format_field(obj, field, template='%s', ignore=(None, ''), default='', func= if func and val not in ignore: val = func(val) return template % val if val not in ignore else default + + +def clean_podcast_url(url): + return re.sub(r'''(?x) + (?: + (?: + chtbl\.com/track| + media\.blubrry\.com| # https://create.blubrry.com/resources/podcast-media-download-statistics/getting-started/ + play\.podtrac\.com + )/[^/]+| + (?:dts|www)\.podtrac\.com/(?:pts/)?redirect\.[0-9a-z]{3,4}| # http://analytics.podtrac.com/how-to-measure + flex\.acast\.com| + pd(?: + cn\.co| # https://podcorn.com/analytics-prefix/ + st\.fm # https://podsights.com/docs/ + )/e + )/''', '', url) |