AnthonyBloomer / ezflix

Command line utility that enables users to search for TV and movie torrents and stream using Peerflix automatically.
https://anthonybloomer.github.io/ezflix/
MIT License
47 stars 9 forks source link

Implementing Enhancement to add Seeds and Peers to the result table #11

Closed jatinkrmalik closed 6 years ago

jatinkrmalik commented 6 years ago

Implementing #10

It was pretty straightforward to parse seeds and peers in YTS api as they were already in this torrent dictionary here: https://github.com/AnthonyBloomer/ezflix/blob/ce4e99ad222f91e6bc3370bde7419e73859b2fc9/ezflix/extractors/yts.py#L26

So, it was matter of adding the respecting keys torrent['seeds'] and torrent['peers'] and appending them in arr list.


For, YTS scrapping though, I noticed, it only gives number of Seeds in the search result table, and the only unique identifier was tag in , so I referenced to it via:

seeds = find_parent().find_parent().find("font").get_text()

after line:

https://github.com/AnthonyBloomer/ezflix/blob/ce4e99ad222f91e6bc3370bde7419e73859b2fc9/ezflix/extractors/eztv.py#L21

and then just appending seeds to the arr list. Since there were no peers, I appended Peers: "-" for easy to modify in future and maintain parity in the final result table.


After this, I just had to add "Seeds" and "Peers" column on line: https://github.com/AnthonyBloomer/ezflix/blob/ce4e99ad222f91e6bc3370bde7419e73859b2fc9/ezflix/main.py#L47

and query them on result dict with result['seeds'] and result['peers'].


This is my first pull request to any project, so please help me understand if I am not following any convention here. Thanks! 🤓

AnthonyBloomer commented 6 years ago

Looks good @jatinkrmalik, nice contribution!