only output info in local mode

This commit is contained in:
j 2018-03-14 17:23:07 +05:30
parent 87b161bf63
commit 63b6db557d

View file

@ -4,12 +4,14 @@ import getpass
import json
import math
import os
import ox
import ox.web.auth
import sys
import urllib.parse
import urllib.request
import ox
import ox.web.auth
base_url = None
stream_resolution = 480
prefix = '/mnt'
@ -17,6 +19,7 @@ render = './cache'
pandora_client_config = {}
use_local = False
class API(ox.API):
def save_url(self, url, filename, overwrite=False):
@ -53,8 +56,8 @@ def get_info(api, oshash, item, part):
'keys': ['id', 'instances', 'resolution']
})['data']
if not r['items'][0]['instances']:
print(r, item, part)
if use_local:
print(r, item, part)
raise Exception('item without instance')
files[oshash] = {
'resolution': r['items'][0]['resolution']