diff options
author | Jesús <heckyel@hyperbola.info> | 2019-07-12 11:33:06 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-07-12 11:33:06 -0500 |
commit | b21940399000058259f8d37f1bde5a1bbd3f298f (patch) | |
tree | 9f5685d33a36b590f1d280c06d354b3775db9047 /livie.py | |
parent | 1d3fa5beac0970a9c9645f2c0adf4543caf7de33 (diff) | |
download | livie-b21940399000058259f8d37f1bde5a1bbd3f298f.tar.lz livie-b21940399000058259f8d37f1bde5a1bbd3f298f.tar.xz livie-b21940399000058259f8d37f1bde5a1bbd3f298f.zip |
fix SyntaxError: invalid syntax closed #1
Diffstat (limited to 'livie.py')
-rw-r--r-- | livie.py | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -7,10 +7,10 @@ import requests URL = 'https://invidious.snopyta.org' INPUT = sys.argv[1] -SEARCH = f'{URL}/api/v1/search?q={INPUT}' +SEARCH = '%s/api/v1/search?q=%s' % (URL, INPUT) REQUEST = requests.get(SEARCH) -UNSD = '&itag=18&local=true' -UNHD = '&itag=22&local=true' +SD = '&itag=18&local=true' +HD = '&itag=22&local=true' FIRST = True # skip line loop @@ -23,8 +23,8 @@ for video in VIDEOS: author = video.get('author', '') # Make URL - sd = f'{URL}/latest_version?id={videoid}{UNSD}' - hd = f'{URL}/latest_version?id={videoid}{UNHD}' + sd = '%s/latest_version?id=%s%s' % (URL, videoid, SD) + hd = '%s/latest_version?id=%s%s' % (URL, videoid, HD) timer = video.get('lengthSeconds', '') time = str(datetime.timedelta(seconds=timer)) @@ -38,10 +38,9 @@ for video in VIDEOS: print() # print skip line # prints - print(f' title: {title}') - print(f' SD: {sd}') - print(f' HD: {hd}') - print(f' HD ^ Only some videos available caused by DRM') - print(f' channel: {author}') - print(f' time: {time}') - print(f' publish: {publish}') + print(' title: %s' % (title)) + print(' SD: %s' % (sd)) + print(' HD: %s' % (hd)) + print(' HD ^ Only some videos available caused by DRM') + print(' channel: %s' % (author)) + print(' time: %s' % (time)) |