Update plex_netflix_check.py

This commit is contained in:
blacktwin 2017-09-15 15:02:45 -04:00 committed by GitHub
parent 7faff46ec4
commit 6051989ece

View File

@ -24,19 +24,19 @@ def instantwatch_search(name, type):
NETFLIX_URL = 'http://www.netflix.com/title/'
if type == 'movie':
search_type = '&content_type%5B%5D=1'
content_type = '1'
elif type == 'show':
search_type = '&content_type%5B%5D=3'
content_type = '3'
else:
search_type =''
content_type =''
search_title = name.lower().replace(' ','+')
search_url = 'http://instantwatcher.com/search?source=1+2+3&q={}'.format(search_title)
payload = {'content_type': content_type,
'q': name.lower()}
r = requests.get('http://instantwatcher.com/search'.rstrip('/'), params=payload)
results_lst = []
r = requests.get(search_url + search_type)
res_data = bf.data(fromstring(r.content))
res_data = res_data['html']['body']['div']['div'][1]
@ -79,6 +79,7 @@ def instantwatch_search(name, type):
else:
print('Could not find exact name match.')
for t in plex.library.section('Movies').all():
print('Running check on {}'.format(t.title))
instantwatch_search(t.title, t.type)