1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

mtvnn: download the right number of episodes

this fixes #132
This commit is contained in:
Johan Andersson 2014-09-27 22:53:41 +02:00
parent fdd09734db
commit ea057fc8fd

View File

@ -48,11 +48,18 @@ class Mtvnn(Service, OpenGraphThumbMixin):
log.error("Couldn't program id")
sys.exit(2)
programid = match.group(1)
match = re.findall(r"data-item-id='([^']+)'", self.get_urldata())
match = re.findall(r"<li class='(divider playlist-item|playlist-item)'( data-item-id='([^']+)')?", self.get_urldata())
if not match:
log.error("Couldn't retrieve episode list")
sys.exit(2)
episodNr = []
for i in match:
if i[0] == "playlist-item":
episodNr.append(i[2])
else:
break
episodes = []
for i in sorted(match):
for i in sorted(episodNr):
episodes.append("http://www.nickelodeon.se/serier/%s-something/videos/%s-something" % (programid, i))
return episodes