aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/eighttracks.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-14 15:52:06 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-14 15:52:06 +0600
commit85741b998660bfb1564ca2c02e233db42059be05 (patch)
treeb295f5caa8dc76c3b9d7d37c85448b42ae1f0429 /youtube_dl/extractor/eighttracks.py
parentf247a199fea35595380e1e55cd455c699af23b03 (diff)
downloadyoutube-dl-85741b998660bfb1564ca2c02e233db42059be05.zip
youtube-dl-85741b998660bfb1564ca2c02e233db42059be05.tar.gz
youtube-dl-85741b998660bfb1564ca2c02e233db42059be05.tar.bz2
[8tracks] Use predefined avg duration when duration is negative (Closes #5200)
Diffstat (limited to 'youtube_dl/extractor/eighttracks.py')
-rw-r--r--youtube_dl/extractor/eighttracks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube_dl/extractor/eighttracks.py b/youtube_dl/extractor/eighttracks.py
index fb5dbbe..869ff72 100644
--- a/youtube_dl/extractor/eighttracks.py
+++ b/youtube_dl/extractor/eighttracks.py
@@ -117,6 +117,9 @@ class EightTracksIE(InfoExtractor):
track_count = data['tracks_count']
duration = data['duration']
avg_song_duration = float(duration) / track_count
+ # duration is sometimes negative, use predefined avg duration
+ if avg_song_duration <= 0:
+ avg_song_duration = 300
first_url = 'http://8tracks.com/sets/%s/play?player=sm&mix_id=%s&format=jsonh' % (session, mix_id)
next_url = first_url
entries = []