Merged
Conversation
liiight
reviewed
Feb 16, 2017
flexget/plugins/sites/newpct.py
Outdated
| response = task.requests.post(url_search, data=data) | ||
| except requests.RequestException as e: | ||
| log.error('Error searching NewPCT: %s' % e) | ||
| return |
Member
There was a problem hiding this comment.
you need to return the empty set or discover will probably crash
| entry['url'] = child['href'] | ||
| entry_title = child.find('h2') | ||
| if entry_title is None: | ||
| continue |
Member
There was a problem hiding this comment.
i'd recommend some debug logging
liiight
requested changes
Feb 17, 2017
flexget/plugins/sites/newpct.py
Outdated
| requests = Session() | ||
| requests.headers.update({'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}) | ||
| requests.add_domain_limiter(TimedLimiter('imdb.com', '2 seconds')) | ||
| requests.add_domain_limiter(TimedLimiter('www.newpct1.com', '2 seconds')) |
Member
There was a problem hiding this comment.
Use just the domain here, no subdomains
flexget/plugins/sites/newpct.py
Outdated
| for search_string in entry.get('search_strings', [entry['title']]): | ||
| query = normalize_unicode(search_string) | ||
| query = re.sub(' \(\d\d\d\d\)$', '', query) | ||
| log.debug('Searching NewPCT %s' % query) |
Member
There was a problem hiding this comment.
Let the logger do the string interpolation:
log.debug('Searching NewPCT %s', query)
flexget/plugins/sites/newpct.py
Outdated
| try: | ||
| response = task.requests.post(url_search, data=data) | ||
| except requests.RequestException as e: | ||
| log.error('Error searching NewPCT: %s' % e) |
flexget/plugins/sites/newpct.py
Outdated
| entry_title = re.sub(' \[.+]$', '', entry_title) | ||
| entry['title'] = entry_title + ' ' + entry_quality_lan | ||
| results.add(entry) | ||
| log.debug('Finish search NewPCT with %d entries' % len(results)) |
flexget/plugins/sites/newpct.py
Outdated
| @@ -64,7 +74,49 @@ def parse_download_page(self, url): | |||
| torrent_id = torrent_id_prog.search(torrent_ids[0]).group(1) | |||
| return 'http://www.newpct.com/torrents/{:0>6}.torrent'.format(torrent_id) | |||
Member
There was a problem hiding this comment.
Consider moving this to be a static const
liiight
approved these changes
Feb 20, 2017
Member
|
thanks, wanna add this to the wiki? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for changes:
Addead search options based on divxatope
Detailed changes:
Addressed issues:
Config usage if relevant (new plugin or updated schema):
Log and/or tests output (preferably both):