📜 ⬆️ ⬇️

Popcorn Time in Russian

On Habré, Popcorn Time has been considered many times ( here , here , here and here ).

This project has one small drawback. There are no films in Russian voice acting. I tried to solve this problem.



In fact, all this is said loudly, the functionality is implemented basicly, please take it to be nothing more than proof of concept . For a couple of evenings, I threw in a small parser of one fairly popular torrent tracker with uploading data to the database and then issuing it in the form of an API that is understandable for Popcorn Time.
')
In technical terms, nothing interesting: nginx, Node.js, Express, MongoDB (Mongoose). Perhaps the most interesting thing to tell about is the conversion of a torrent file into a magnet link , but even this, using the bencode package, becomes very simple:

var metadata = bencode.decode(body), sha1 = crypto.createHash('sha1'); sha1.update(bencode.encode(metadata.info)); film['hash'] = sha1.digest('hex'); film['magnet'] = 'magnet:?xt=urn:btih:' + film['hash'] + '&dn=' + metadata.info.name; 

All this is up and running. You can try out 2 ways.

1. Download the Popcorn Time compiled by me. Unfortunately, only Linux 64 bit , thanks to koot Mac .
2. Download Popcorn Time with git , make changes in the code (under the spoiler below) and build the project as written here .
diff
 diff --git a/src/app/lib/models/movie_collection.js b/src/app/lib/models/movie_collection.js index bb73eaa..58f40e1 100644 --- a/src/app/lib/models/movie_collection.js +++ b/src/app/lib/models/movie_collection.js @@ -11,7 +11,7 @@ return { torrents: App.Config.getProvider('movie'), subtitle: App.Config.getProvider('subtitle'), - metadata: App.Trakt + metadata: null }; } }); diff --git a/src/app/settings.js b/src/app/settings.js index 291c07c..06fd21e 100644 --- a/src/app/settings.js +++ b/src/app/settings.js @@ -66,8 +66,8 @@ Settings.deleteTmpOnClose = true; Settings.updateApiEndpoint = 'http://popcorntime.io/'; /* TODO: Buy SSL for main domain + buy domain get-popcorn.re for fallback Settings.updateApiEndpointMirror = 'https://popcorntime.cc/'; */ -Settings.yifyApiEndpoint = 'http://yts.re/api/'; -Settings.yifyApiEndpointMirror = 'http://yts.im/api/'; +Settings.yifyApiEndpoint = 'http://yts.lafin.me/api/'; +Settings.yifyApiEndpointMirror = 'http://yts.lafin.me/api/'; Settings.connectionCheckUrl = 'http://google.com/'; // App Settings 


Sources backend parts http://github.com/lafin/ru-yts

On this, perhaps, everything. Have a nice watching.



PS I hope someone continues the idea.

Up. Added filter by genre and sort by year and alphabet.

Source: https://habr.com/ru/post/241551/


All Articles