From 6051989ece740d05d49ab2ee48690a75a0a7e72f Mon Sep 17 00:00:00 2001 From: blacktwin Date: Fri, 15 Sep 2017 15:02:45 -0400 Subject: [PATCH] Update plex_netflix_check.py --- reporting/plex_netflix_check.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/reporting/plex_netflix_check.py b/reporting/plex_netflix_check.py index 1e8e3f0..3cd4df1 100644 --- a/reporting/plex_netflix_check.py +++ b/reporting/plex_netflix_check.py @@ -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)