-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add torrent sub-command #64
Comments
I'm just thinking what is the best: |
Getting both the magnet and the torrent file are fairly trivial, they're both displayed after the search is made. I'm curious as to how to select the right episode to download. Also, since different fansubs post their content on nyaa.si, it would be hard to correctly use the
|
Yes, the right episode is the hard thing here, because the data is not consistent and the my whole discussion about not implementing the
Yes, we can combine size & seed filtering to get the pack.
About give priority to more known fansub can be a problem. Probably we did not have this type of information anywhere, right? Clearly, accessible and able to fetch/parsing. We have? If not, so using that we'll do some type of hard-coding. This is not very nice. I would like to avoid that approach if is possible.
I agreed about the After I got some time to try implement it and your PR be accepted, I'll check these approachs and see which will be better. |
Ok! I will make some changes in torrench in order to get the PR accepted sometime this week. Ping me when you have something. |
It would be also good to search based on specific fansub or provide the regex search manually. Something like that.
or
|
The fansub flag can be useful, we can filter that after the match of anime name through the MyAnimeList data. But |
|
It seems that my PR will be merged either today or quite soon. A couple of changes have been made to the code: now, by default, the magnet link is copied to clipboard after the torrent is selected from the list and the script now interacts with Transmission, which is a torrent client for Linux. |
@datafanatic What you are using to copy to clipboard? Honestly, I don't think copying clipboard by default is a good thing to do. Why just send to stdout and let the user copy it however they like or you can provide |
@kutsan It's the default behaviour expected from modules in Torrench, so I simply implemented the same way the other modules work. But I agree, security wise it might not be the best approach. Maybe @kryptxy has anything to say about it?
This is also done, both the torrent URL and the magnet links are printed to stdout and loaded to the client (transmission) if the user so desires. |
@datafanatic Thanks for answer. Looking forward to this feature. BTW, saw your request at MAL. Seems like we both have same likings. |
@kutsan Okay :) Regarding MAL, yes, indeed. Perhaps we can recommend shows to each other some time. :) |
Great news, @datafanatic. I hope we can implement this feature of |
No worries, @ryukinix. My PR has been merged today, FYI. Ping me when you start working on it and I'll help with what I can. Good luck with college! |
Thanks. Nice to hear about it! When I begin to work on that I'll ping you on this thread. |
Hey @ryukinix, I hope you're doing well. I'm just curious how's this project going. It's already been ~three months. I don't want to put pressure on you or something; just out of curiosity. I would like to let you know I'm looking forward to its features for my daily use. |
@kutsan hello! I've been busy for all this time on college, sorry. My vacation started yesterday! :) Thanks for the ping and sorry for the long time to implement this, my college is eating my time. EDIT: (three months later)
|
Perhaps this should be moved to a separate tool. I can see a pretty nice workflow happening between A collaborative effort to imbibe nyaa with a fleshed out API and a text-based browser to nab urls from it interactively or non-interactively might yield great results. After you get that working well, it's not too hard to imagine that you could add a torrent command that would simply outsource the task to |
Yes, thinking a little through all that months I would not too happy adding more dependencies to project and this functionality directly. However... would be nice create a nice interface of torrench unfortunatelly have a mass conf stuff that I don't like to obey users to use that and add optionals features seems even more complicated to me... Maybe I'm being too stupid about that, but I really like to keep things more simple, I already think that this tool it's almost (almost) complicated (I think in simplify things a long time, but I'll not do some things probably), so at least not adding complex features it's even more important. If you see all the history, actually, this feature was even more ambicious than this thread, you can look the main features at #3 #4 (on beginning). I'm not dropping this feature yet, I'm just thinking about it a little. If we find a nice way to combine tools, I'd prefer that than adding more dependencies. This is a quite different approach than #81 stuff that is relying in more software that no everyone uses it. I'd like if you provide some possible POC of the combination of user-case to the tools that you described @bradenbest. |
Proof of concept? I'm pretty sure GNU tar does this with its
Looking around google, I can't find any confirmation of what I said, so unfortunately, I'm going to have to dig into the source code to find out. If you've ever read GNU's source code, you know this is going to be painful. They use the "I don't give a fuck" style of programming where functions are hundreds of lines long and frequently nest in vast networks of deep complicated control structures and preprocessor macros. It's a nightmare. Eh, all I'm doing is complaining now. Let's dive in. Looking in tar's source code
Okay, let's see what
God I hate GNU's style (FYI, I've been fixing the broken indentation this whole time, it's actually a lot uglier if you look at the rest of the code. The function I quoted above is actually pretty well-written aside from the broken indentation). ANYWAYS, so there's a global variable called
And it is. So, FINALLY, we get an answer. Yes, tar is literally calling the program That said, as that is part of the POSIX C standard library, it should be available in a python wrapper. And it is. https://docs.python.org/3/library/os.html#process-management I can tell you from experience that execvp and its kin are kind of a pain in the ass to use, as the OS is fickle about how you set up the environment, and you're also supposed to Now that we've established that this is a real thing used by real programs, I think it's safe to say you have your proof of concept. In the same way, you would https://docs.python.org/3/library/subprocess.html Alright. Time for me to hit the hay. |
That said, I figure you probably wanted a demonstration, so... https://gist.github.com/bradenbest/a3c531307a2f76e690901522c628b6b0 The only reason this took me nine hours is because 90% of it was sleeping and 10% of it was writing code. And 90% of that 10% was spent fighting with python over weird little errors and unexpected/tricky-to-predict behavior, because I'm not all that used to python's standard library, or substrings. For example, what does Combine that with trying to match multi-character sequences and splice out a substring, and that's a good half hour trying to figure out why Sorry for ranting. I'm just annoyed that it took an hour to write instead of 15 minutes. |
Description
We should be able to get the torrent file or magnet link for the next episode passing a
anime_regex
exactly how other commands likesearch
,filter
,add
currently does. Some users recommended to me for default get the anime torrent/magnet-links from torrents hosted intohttp://nyaa.si/
. Maybe this can be possible through the recent PR integration of nyaa.si intotorrench
, a multi-platform API and CLI written in Python integrating various torrent search engines (as suggested by @datafanatic in previous discussion at #3)Design choices
The default behaviour for search is to fetch the desired anime based on your MyAnimeList data, so then get the torrent or magnet link of the next episode on your list. That way we can pass short names and not worry about multiple matches (like just typing
steins
and returnSteins;Gate
because is that all you have in your watching list (supposition). Remember that all the search process happens through simple regex through your MyAnimeList profile content.When we found multiple results, as another commands which make a action based a provided anime_regex, we should print the multiple results and ask for the user (via stdin) which anime he meant by a index (likely how torrench does too, but without using tabulate).
Usage
Download the torrent file
Download the torrent file of the next episode of
lain
which is translated toSerial Experiments Lain
based through the mal data so then.Get magnet link
Similiar to above, but print to stdout the magnet link for the next episode
Can be implemented a
-m
flag as aliasExtra
--all
flag to select a torrent from the provided anime with all the episodes (full-pack)--engine SEARCH_ENGINE
or==search SEARCH_ENGINE
, we should choose the better.Roadmap for torrent command
-m
alias--all
flag to get torrent/magnet-link with all episodes--engine
or--search
argument to select the search engine to use with torrenchThe text was updated successfully, but these errors were encountered: