format_priorities = [
'22/2000000/9/0/115', # 1280x720
'35/640000/9/0/115', # 640x360
'18/512000/9/0/115', # 480x270
'34/0/9/0/115', # 320x180
'5/0/7/0/0', # 320x180
]
for wanted in format_priorities:
if wanted in formats_available:
format, rest_ = wanted.split('/', 1)
fmt_id = int(format)
available.append(fmt_id)
format_priorities = [
'22/2000000/9/0/115', # 1280x720
'35/640000/9/0/115', # 640x360
'18/512000/9/0/115', # 480x270
'34/0/9/0/115', # 320x180
'5/0/7/0/0', # 320x180
]
format_priorities = [
'22/2000000/9/0/115', # 1280x720
'35/854x480/9/0/115',
'34/640x360/9/0/115',
# '35/640000/9/0/115', # 640x360
'18/512000/9/0/115', # 480x270
# '34/0/9/0/115', # 320x180
# '5/0/7/0/0', # 320x180
'5/320x240/7/0/0',
]
else:
formats_available = []
print "formats available: %r" % (formats_available,)
# This is the proritized list of formats that zoutube will
else:
formats_available = []
#add the default format (18)
formats_available.append('18/512000/9/0/115')
print "formats available: %r" % (formats_available,)
# This is the proritized list of formats that zoutube will