-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element not found when parsing dates #35
Comments
I found that it happens due to the way TPB reports recent torrents, like "Today 04:59", or "10 mins ago". To fix that I added the following method to class "parser":
... and in method "parse" of the same class, I call _fix_date just before _parse:
Despite not an elegant solution (it was clearly coded in a hurry), it works fine ;-) Obs: This fix needs "re" module, so you must include it in the top of parser.py. |
I currently haven't time to look into this but I'll try to write some tests for it when I do. Thanks for the contribution!! |
I'll look over this in a few days. Very busy with exams this week. :/ |
I started working on this (finished my exams too :-p) though I didn't wrote the tests yet, give me till tomorrow ;-) |
Fixed #35 -- correct torrent creation date parsing
Finally corrected in 203b533 |
Hi,
It's my first time using Python so my debugging skills are very rough, but upon iterating over some search results, I'm getting the following error:
TypeError: 'NoneType' object is not iterable
Stack trace ends with the following:
After digging into the code, line 102 in tpb.py seems to be the one causing issues
created = dateutil.parser.parse(match.groups()[0].replace('\xa0', ' '))
When replaced with datetime.new() it works. Having said that, it might be TPB itself causing problems as I can't reliably reproduce the issue 100% of the time... sometimes it just works. Any thoughts?
The text was updated successfully, but these errors were encountered: