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

svtplay: in -A and --all-last sort the list if we have episodeNumber

fixes #800
This commit is contained in:
Johan Andersson 2018-02-21 22:12:52 -05:00
parent 68553d9870
commit 2fb54e368b

View File

@ -6,6 +6,7 @@ import os
import copy import copy
import json import json
import hashlib import hashlib
from operator import itemgetter
from svtplay_dl.log import log from svtplay_dl.log import log
from svtplay_dl.service import Service, OpenGraphThumbMixin from svtplay_dl.service import Service, OpenGraphThumbMixin
@ -209,6 +210,8 @@ class Svtplay(Service, OpenGraphThumbMixin):
return episodes return episodes
def videos_to_list(self, lvideos, videos): def videos_to_list(self, lvideos, videos):
if "episodeNumber" in lvideos[0] and lvideos[0]["episodeNumber"]:
lvideos = sorted(lvideos, key=itemgetter('episodeNumber'))
for n in lvideos: for n in lvideos:
parse = urlparse(n["contentUrl"]) parse = urlparse(n["contentUrl"])
if parse.path not in videos: if parse.path not in videos: