diff options
author | Jesús <heckyel@hyperbola.info> | 2019-07-07 19:58:35 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-07-07 19:58:35 -0500 |
commit | 6d02f8e10323b92f95ed0de66f17008e751dc876 (patch) | |
tree | c7b6affd1def3635387c0ba904ad137cdd8e3157 | |
parent | d73d001707e6bbf9f564b225087e7a3418a91f3d (diff) | |
download | livie-6d02f8e10323b92f95ed0de66f17008e751dc876.tar.lz livie-6d02f8e10323b92f95ed0de66f17008e751dc876.tar.xz livie-6d02f8e10323b92f95ed0de66f17008e751dc876.zip |
improve sintax
-rw-r--r-- | livie.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -6,8 +6,9 @@ import json import requests BASE_URL = 'https://invidious.snopyta.org' +SEARCH = sys.argv[1] ITAG = '&itag=18&local=true' -URL = "{}/api/v1/search?q={}".format(BASE_URL, sys.argv[1]) +URL = f'{BASE_URL}/api/v1/search?q={SEARCH}' RUTA = requests.get(URL) FIRST = True # skip line @@ -18,7 +19,7 @@ for video in VIDEOS: title = video.get('title', '') videoid = video.get('videoId', '') author = video.get('author', '') - link = "{}/latest_version?id={}{}".format(BASE_URL, videoid, ITAG) + link = f'{BASE_URL}/latest_version?id={videoid}{ITAG}' timer = video.get('lengthSeconds', '') time = str(datetime.timedelta(seconds=timer)) publish = video.get('publishedText', '') |