popcorn-official / popcorn-api

Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player. Compatible API Anime/Movies/Show Scrapper
https://popcorntime.app
MIT License
622 stars 101 forks source link

Look within whole season torrents for individual episodes #29

Open NickStrupat opened 8 years ago

NickStrupat commented 8 years ago

There are a lot of shows which don't have healthy torrents for each episode, but have at least one healthy torrent for each whole season. The show providers could be modified to search for common "whole season" torrent naming schemes. This should greatly increase the number of available shows, mostly those older than a year or two.

Examples

The show providers would need to retrieve the torrent metadata (torrent file is more direct, but obviously possible with magnet links), then try to match the episodes with the files in the torrent. Episode file names almost always match [Ss]\d\d[Ee]\d\d or \d\dx\d\d or similar scheme.

NickStrupat commented 8 years ago

It looks like the episode objects just have a torrent property containing a magnet link, with the engine assuming the largest file in the metadata as the episode of the show. My proposed change would require adding an optional filename property to the episode objects, throught the stack, to track the individual episode files within a torrent which contains a whole season/series.

The popcorn-desktop project and other front-ends would need to be changed as well to understand the new feature.

ChrisAlderson commented 8 years ago

It is an interesting idea which could be incorporated into the api. But I am not qualified to say if it is possible on the client side (popcorn-desktop), and if it is possible how big the impact would be.

NickStrupat commented 8 years ago

Thanks for your reply.

Having the new filename property be optional would require minimal change on the client side. The client would just have an extra conditional block to check if filename property exists on the episode object, then stream that file instead of the current logic (again, only if the filename property exists.

I'll check out the client code (popcorn-desktop) a bit closer to be sure. What kind of coordination do you folks usually need to make changes across two projects?

hayzamjs commented 7 years ago

Hey Nick,

Did you manage to do it?