diff --git a/scrapeit/btutils.py b/scrapeit/btutils.py index 461fd8b..e5e8b37 100644 --- a/scrapeit/btutils.py +++ b/scrapeit/btutils.py @@ -34,26 +34,33 @@ def movieType(title): title = title.lower() if 'trailer' in title: return 'trailer' + if 'vcd' in title and 'cam' in title: + return 'vcd-cam' if 'cam' in title: return 'cam' if 'vcd' in title: return 'vcd' - for key in ('telesync', 'telecine', '.ts', '.tc', ' tc ', ' ts', 'ts-screener'): + for key in ('telecine', '.tc', ' tc '): if key in title: return 'telecine' + for key in ('telesync', '.ts', ' ts', 'ts-screener'): + if key in title: + return 'telesync' for key in ('dvdrip', 'dvdscrs', 'dvdscr', 'dvd rip'): if key in title: return 'dvdrip' + for key in ('blu-ray rip', 'bdrip'): + if key in title: + return 'hdrip' if 'screener' in title: return 'screener' - if 'xvid' in title: - return 'Xvid' if '1080p' in title: return '1080p' if '720p' in title: return '720p' - if 'dvdr' in title: - return 'DVDR' + for key in ('dvdr', 'dvd-r'): + if key in title: + return 'DVDR' return '' def filterMovies(movies): diff --git a/scrapeit/thepiratebay.py b/scrapeit/thepiratebay.py index 8d3bf62..30453cf 100644 --- a/scrapeit/thepiratebay.py +++ b/scrapeit/thepiratebay.py @@ -132,8 +132,7 @@ def getInfo(piratebayID): try: txt = read_url(url).decode('utf-8', 'replace') except URLError, e: - print e.errno - if e.errno == 404: + if e.code == 404: return None title = re.compile('