fix SyntaxError: invalid syntax closed #1

This commit is contained in:
Jesús 2019-07-12 11:33:06 -05:00
parent 1d3fa5beac
commit b219403990
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
2 changed files with 12 additions and 13 deletions

View File

@ -12,7 +12,7 @@ Livie allows the user to search youtube.com and play the video from `mpv`.
## Requirements ## Requirements
- `python >= 3.6` - `python >= 3.5`
- `python-requests` - `python-requests`
- `mpv` - `mpv`

View File

@ -7,10 +7,10 @@ import requests
URL = 'https://invidious.snopyta.org' URL = 'https://invidious.snopyta.org'
INPUT = sys.argv[1] 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) REQUEST = requests.get(SEARCH)
UNSD = '&itag=18&local=true' SD = '&itag=18&local=true'
UNHD = '&itag=22&local=true' HD = '&itag=22&local=true'
FIRST = True # skip line loop FIRST = True # skip line loop
@ -23,8 +23,8 @@ for video in VIDEOS:
author = video.get('author', '') author = video.get('author', '')
# Make URL # Make URL
sd = f'{URL}/latest_version?id={videoid}{UNSD}' sd = '%s/latest_version?id=%s%s' % (URL, videoid, SD)
hd = f'{URL}/latest_version?id={videoid}{UNHD}' hd = '%s/latest_version?id=%s%s' % (URL, videoid, HD)
timer = video.get('lengthSeconds', '') timer = video.get('lengthSeconds', '')
time = str(datetime.timedelta(seconds=timer)) time = str(datetime.timedelta(seconds=timer))
@ -38,10 +38,9 @@ for video in VIDEOS:
print() # print skip line print() # print skip line
# prints # prints
print(f' title: {title}') print(' title: %s' % (title))
print(f' SD: {sd}') print(' SD: %s' % (sd))
print(f' HD: {hd}') print(' HD: %s' % (hd))
print(f' HD ^ Only some videos available caused by DRM') print(' HD ^ Only some videos available caused by DRM')
print(f' channel: {author}') print(' channel: %s' % (author))
print(f' time: {time}') print(' time: %s' % (time))
print(f' publish: {publish}')