spacing and shebang
This commit is contained in:
parent
59675d4a5b
commit
5ea6211956
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
'''
|
'''
|
||||||
Pull poster images from Imgur and places them inside Shows root folder.
|
Pull poster images from Imgur and places them inside Shows root folder.
|
||||||
/path/to/show/Show.jpg
|
/path/to/show/Show.jpg
|
||||||
@ -28,6 +29,7 @@ class IMGURINFO(object):
|
|||||||
self.link = d['link']
|
self.link = d['link']
|
||||||
self.description = d['description']
|
self.description = d['description']
|
||||||
|
|
||||||
|
|
||||||
def get_imgur():
|
def get_imgur():
|
||||||
url = "https://api.imgur.com/3/album/{ALBUM_ID}/images".format(ALBUM_ID=ALBUM_ID)
|
url = "https://api.imgur.com/3/album/{ALBUM_ID}/images".format(ALBUM_ID=ALBUM_ID)
|
||||||
headers = {'authorization': 'Client-ID {}'.format(CLIENT_ID)}
|
headers = {'authorization': 'Client-ID {}'.format(CLIENT_ID)}
|
||||||
@ -35,6 +37,7 @@ def get_imgur():
|
|||||||
imgur_dump = r.json()
|
imgur_dump = r.json()
|
||||||
return[IMGURINFO(data=d) for d in imgur_dump['data']]
|
return[IMGURINFO(data=d) for d in imgur_dump['data']]
|
||||||
|
|
||||||
|
|
||||||
for x in get_imgur():
|
for x in get_imgur():
|
||||||
# Check if Show directory exists
|
# Check if Show directory exists
|
||||||
if os.path.exists(os.path.join(SHOW_PATH, x.description)):
|
if os.path.exists(os.path.join(SHOW_PATH, x.description)):
|
||||||
|
Loading…
Reference in New Issue
Block a user