Skip to content
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

Torrent Generation on not found error #1600

Merged
merged 54 commits into from
Oct 21, 2017
Merged

Torrent Generation on not found error #1600

merged 54 commits into from
Oct 21, 2017

Conversation

akuma06
Copy link
Member

@akuma06 akuma06 commented Sep 19, 2017

As asked in #1517, it allows on-the-fly torrent generation. Since it uses magnet links, it needs some time to connect to peers. So it can't be instant generation, we need the user to wait and try after a minute at least.

Edit: Seems like I can't test the PR on my windows machine because Anacrolyx torrent doesn't want to compile...
Edit 2 : Works on windows if you have gcc installed, I used msys2 and its tutorial for that https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2

As asked in #1517, it allows on-the-fly torrent generation. Since it uses magnet links, it needs some time to connect to peers. So it can't be instant generation, we need the user to wait and try after a minute at least.
@Kiloutre
Copy link
Contributor

Kiloutre commented Sep 19, 2017

I have no idea what ewhal exactly did, he didn't even commit the changes here, but torrent file generation is already there and working for seemingly every single torrent
Not sure if done on download.go or if he has a script running somewhere that does it for every one of them though
But dont work on this any more until @ewhal gives clarifications as it's a potential waste of time
(Hence why i closed the issue)

@ewhal
Copy link
Member

ewhal commented Sep 20, 2017

The torrent generation script is shit so this is a very good idea

@coveralls
Copy link

Coverage Status

Coverage remained the same at 39.458% when pulling 4fedc30 on generatetorrent into 67d8492 on dev.

@akuma06
Copy link
Member Author

akuma06 commented Oct 7, 2017

Si quelqu'un peut tester please =)

@akuma06 akuma06 changed the title [WIP] Torrent Generation on not found error Torrent Generation on not found error Oct 7, 2017
@Kiloutre
Copy link
Contributor

Kiloutre commented Oct 7, 2017

I tried already yesterday but i get a GCC error when go building

@akuma06
Copy link
Member Author

akuma06 commented Oct 7, 2017

Yeah it seems anacrolyx doesn't compile on windows. We need someone with linux :/

@coveralls
Copy link

Coverage Status

Coverage remained the same at 39.589% when pulling c6cc047 on generatetorrent into 10a70e1 on dev.

Kiloutre
Kiloutre previously approved these changes Oct 7, 2017
Copy link
Contributor

@Kiloutre Kiloutre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haven't tested but in case you wanna merge it still

@akuma06
Copy link
Member Author

akuma06 commented Oct 7, 2017

I don't think we should, it will prevent people to build nyaa on windows :/

@akuma06
Copy link
Member Author

akuma06 commented Oct 7, 2017

Ok to build on windows you need gcc. I just successfully build with the help of msys2 and this tutorial : https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2

@akuma06
Copy link
Member Author

akuma06 commented Oct 7, 2017

Tested on my end and it works

@coveralls
Copy link

Coverage Status

Coverage remained the same at 39.589% when pulling 8f170b3 on generatetorrent into 10a70e1 on dev.

"github.com/NyaaPantsu/nyaa/utils/format"
"github.com/gin-gonic/gin"
)

// DownloadTorrent : Controller for downloading a torrent
func DownloadTorrent(c *gin.Context) {
hash := c.Param("hash")
messages := msg.GetMessages(c)

if hash == "" { // if no hash provided, you can't find a torrent in db neither the torrent file
Copy link
Contributor

@Kiloutre Kiloutre Oct 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no /download/ route, only /download/:hash
If hash is empty then download.go will never get executed in the first place, i think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right but I don't know if we should really not check it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked it

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 39.443% when pulling fea276e on generatetorrent into bad9285 on dev.

@akuma06
Copy link
Member Author

akuma06 commented Oct 11, 2017

It might be related to windows emulation, it seems the error is windows coroutines related. It would be great to test it on linux :). The easy way to make the error happen is to launch a torrent download and refresh just after before the torrent has been generated.

@Kiloutre
Copy link
Contributor

Kiloutre commented Oct 11, 2017

Even if it's windows-specific, pantsu is supposed to be able to be ran on anyone's machine, so it would be nice to get it working on windows as well
Besides, i think it worked fine a bunch of commits ago? I'll download an old one and see if it works

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 39.38% when pulling b4cd6a2 on generatetorrent into 2044a3c on dev.

@Kiloutre
Copy link
Contributor

Ran it on dev and it does not seem to work either

@akuma06
Copy link
Member Author

akuma06 commented Oct 11, 2017

Ok will take a look at it when I have time =)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 39.38% when pulling cfc98ca on generatetorrent into 941aceb on dev.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 39.38% when pulling 447f89e on generatetorrent into 941aceb on dev.

ewhal
ewhal previously approved these changes Oct 15, 2017
@Kiloutre
Copy link
Contributor

no
not working
no merging

@Kiloutre Kiloutre changed the title Torrent Generation on not found error [WIP] Torrent Generation on not found error Oct 15, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 39.358% when pulling edea8a8 on generatetorrent into d3e50b8 on dev.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 39.369% when pulling 4ae6944 on generatetorrent into 2f0e06c on dev.

Seems like this error is a known bug from  anacrolyx torrent anacrolix/torrent#83

To prevent it, I'm creating a single client and modifying the socket.go to make it not raise a panic but a simple error log.
@akuma06 akuma06 changed the title [WIP] Torrent Generation on not found error Torrent Generation on not found error Oct 19, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 39.38% when pulling ea155e3 on generatetorrent into 2f0e06c on dev.

@Kiloutre
Copy link
Contributor

Seems to work, gonna try on linux now

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 39.38% when pulling a19ddfd on generatetorrent into 33c8303 on dev.

@akuma06
Copy link
Member Author

akuma06 commented Oct 20, 2017

@Kiloutre ??

Copy link
Contributor

@Kiloutre Kiloutre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sry i needed ewhal to test and he simply he isn't there so i couldn't do it
gonna approve anyway so that you can merge if you want

@akuma06 akuma06 merged commit b2b48f6 into dev Oct 21, 2017
@akuma06 akuma06 deleted the generatetorrent branch October 21, 2017 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants