-
Notifications
You must be signed in to change notification settings - Fork 150
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
Conversation
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.
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 |
The torrent generation script is shit so this is a very good idea |
Si quelqu'un peut tester please =) |
I tried already yesterday but i get a GCC error when go building |
Yeah it seems anacrolyx doesn't compile on windows. We need someone with linux :/ |
There was a problem hiding this 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
I don't think we should, it will prevent people to build nyaa on windows :/ |
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 |
Tested on my end and it works |
controllers/torrent/download.go
Outdated
"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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checked it
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. |
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 |
Ran it on dev and it does not seem to work either |
Ok will take a look at it when I have time =) |
no |
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.
Seems to work, gonna try on linux now |
@Kiloutre ?? |
There was a problem hiding this 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
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