projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f247a19
)
[8tracks] Use predefined avg duration when duration is negative (Closes #5200)
author
Sergey M․
<dstftw@gmail.com>
Sat, 14 Mar 2015 09:52:06 +0000
(15:52 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 14 Mar 2015 09:52:06 +0000
(15:52 +0600)
youtube_dl/extractor/eighttracks.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/eighttracks.py
b/youtube_dl/extractor/eighttracks.py
index fb5dbbe2b0c7d9bd15b87426e446ce73f903a6eb..869ff72d654d732a0e092f209cbb910af3d0bd5e 100644
(file)
--- 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 = []