vikstrous / pirate-get

A command line interface for The Pirate Bay
GNU Affero General Public License v3.0
337 stars 53 forks source link

Script exits with error: Exception: 'NoneType' object has no attribute 'group' #135

Closed tedmunga closed 4 years ago

tedmunga commented 4 years ago

pirate-get errors when trying to copy to clipboard or displaying information.

elect links (Type 'h' for more options, 'q' to quit): h

Options:

: Download selected torrents [m]: Save magnets as files [c]: Copy magnets to clipboard [t]: Save .torrent files [d]: Get descriptions [f]: Get files [p] Print search results [q] Quit Select links (Type 'h' for more options, 'q' to quit): c0 Exception: 'NoneType' object has no attribute 'group' I am on Ubuntu 20.04 $ python Python 3.8.2 (default, Apr 27 2020, 15:53:34) [GCC 9.3.0] on linux
rnhmjoj commented 4 years ago

Thank you, I have never noticied this before. There was a problem with a regex that matched the magnet info hash: I should have fixed it with f115bfd8d3435496474ce0111e0ce909b4e049da.

rnhmjoj commented 4 years ago

@vikstrous can you upload v0.3.7 to pypi?

vikstrous commented 4 years ago

0.3.7 released

rnhmjoj commented 4 years ago

Thank you!

tedmunga commented 4 years ago

It looks like the clipboard has been fixed but options m t d

all exit with this error. Exception: 'NoneType' object has no attribute 'group'

rnhmjoj commented 4 years ago

It's more 404s. It looks like the pirate bay has completely changed their interface. Now they only serve a JS that's doing some requests to a JSON api at https://apibay.org. It should be a lot easier to deal with than parsing html but pirate-get should be rewritten.

tedmunga commented 4 years ago

do you think a rewrite is likely to happen?

rnhmjoj commented 4 years ago

It is happening, see #136. I started working on this yesterday and it's already pretty good. If you want to try it out I can give you directions: it could use some more testing.

tedmunga commented 4 years ago

I'd love to test it. how can I get a copy of the new one?

rnhmjoj commented 4 years ago

If you know git, clone the repository and switch to the api branch; otherwise download this archive and extract it.

If you have pirate-get installed in your system, you should already have all the dependency needed so, go to the directory you have just extracted and try running

python -m pirate.pirate <options>

this is the equivalent of pirate-get <options>.

Also, If you'd like to install the new version try

pip install .
rnhmjoj commented 4 years ago

Fixed in v0.4.0.

tedmunga commented 4 years ago

Excellent thank you :)