Coder Social home page Coder Social logo

attractorr's People

Contributors

balupton avatar billyb2 avatar dependabot[bot] avatar jerzybrzoska avatar jtrv avatar orhun avatar rnestler avatar ubruhin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

attractorr's Issues

Improve command line output

Currently the command line output just uses the derived Debug trait implementation to print the torrents. A nicely formatted output would be appreciated.
Maybe look at term or rust-ansi-term. The later seems better documented.

  • Add a term crate to Cargo.toml
  • Add a function that formats a single torrent in color to src/torrent/mod.rs
  • Use this function to print the output in src/main.rs

1337x searches

If you wanted, I could add the ability to search for L337X data by using the torrent_search crate.

Sort torrents

Currently the torrents will be displayed in the order they where received. In the case of a single provider they're mostly already sorted by the number of seeders, but with multiple providers this fails.

Tipps:

impl Torrent {
    fn compare_seeders(other: &Torrent) -> Ordering
}

See this example.

  • Sort by seeders by default
  • Maybe add a command line argument to sort by other attributes

Refactor code using a SearchProvider trait

Currently we use two simple functions. Ideally we would use a trait SearchProvider which defines a function search(keyword: &str) -> Vec<Torrent>. This would then be implemented for a struct PirateBaySearch{}.
For someone to get started:

  • Change code to use a fn search(&str) ->Vec<Torrent> function which creates the search URL (see strings)
  • Add SearchProvider trait (see traits)
  • Add PirateBaySearch struct containing the hyper connection

[BUG]: L337X prints an error if there are no results

Example:

โฏ attractorr "dshajfksdlhajdfklhdsjaklfhdjsaklhfjka"
[2023-02-06T20:41:37.231Z ERROR attractorr] L337X error: No search results
No results were found

This behavior isn't present for the other search providers, so I'm assuming it's a bug.

Major versions of dependencies

How would you feel about always using the latest non-breaking version of all dependencies. For example, using every release of percent-encoding version 2 instead of one specific release, or the same with tokio 0.2

Current design issues / open questions

This is just a brain dump for me regarding some open points of the project.

Magnet links

Currently we create them with just the "Exact Topic" / BitTorrent info hash. While this works (which is quite awesome) we may consider to include:

  • Display Name
  • eXact Length
  • Address TRacker

Probably we also want to add support for BitTorrent info hash v2 (BTMH)

Displaying torrents in the terminal

Currently we only show:

  • Seeders / Leechers
  • Name
  • magnet URL

It may be interesting to add

  • Source (pirate-bay, yts, ...)
  • size (in human readable form) (#168)
  • ...

Also it is not clear how to best format the output to be usable. As long as the magnet links are clickable it should be OK though.

Interactive mode

Currently we collect all torrents and then display them. This is a bit inefficient, since the most interesting results may already be available while we still wait for a slower source (For example: I mostly disable l337x, since it is rather slow).

I experimented a long time ago with a GTK frontend (#10), which would work asynchronously. We could also use a TUI which would display results in a table interactively.

Linuxu Ubuntu 18.04 - VirtualBox VM

I cloned the project, install openssl accordingly and ran cargo.
it did not build/compile; however when I attempted it on MacBook pro 2018 it worked.

don't output error magnets

adjusted request

Actual:

> torrent-search --sort=seeders asdasdasdasdasdasdlkalsdkasld
[2021-10-23T19:19:09.934Z ERROR torrent_search] L337X error: No search results
S:0/L:0 - No results returned
magnet:?xt=urn:btih:0000000000000000000000000000000000000000

> echo "$?"
0

Expected:

> torrent-search --sort=seeders asdasdasdasdasdasdlkalsdkasld
> echo "$?"
0

Perhaps with stderr output of:

no results were found

So direct users can know what happened.

original issue

actual:
> torrent-search --sort=seeders asdasdasdasdasdasdlkalsdkasld
[2021-10-23T19:19:09.934Z ERROR torrent_search] L337X error: No search results
S:0/L:0 - No results returned
magnet:?xt=urn:btih:0000000000000000000000000000000000000000

> echo "$?"
0

expected:

> torrent-search --sort=seeders asdasdasdasdasdasdlkalsdkasld
[2021-10-23T19:19:09.934Z ERROR torrent_search] L337X error: No search results
S:0/L:0 - No results returned
magnet:?xt=urn:btih:0000000000000000000000000000000000000000

> echo "$?"
1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.