Skip to content
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

Popcorn time changed their package format / download source #8800

Closed
MasseGuillaume opened this issue Jul 13, 2015 · 34 comments
Closed

Popcorn time changed their package format / download source #8800

MasseGuillaume opened this issue Jul 13, 2015 · 34 comments

Comments

@MasseGuillaume
Copy link
Contributor

Hey @bobvanderlinden,

I cannot get the new package format to work. This is what I have so far: https://github.com/MasseGuillaume/nixpkgs/blob/a2505fcac96681d118dd561f1652a340d101b6c7/pkgs/applications/video/popcorntime/default.nix#L26

  1. new mirror
    1. mirror 1: http://178.62.189.137/build/Popcorn-Time-0.3.8-0-Linux-64.tar.xz
    2. mirror 2: http://104.131.61.151/build/Popcorn-Time-0.3.8-0-Linux-64.tar.xz
  2. new package format
  • Node Webkit 12.1 (now known as nw.js)

package content:

CHANGELOG.md  install           LICENSE.txt  node_modules  package.json  popcorntime.png  src
icudtl.dat    libffmpegsumo.so  locales      nw.pak        Popcorn-Time  README.md
@bobvanderlinden
Copy link
Member

Hey thanks for the initial work! They seem to have combined the nw binary and package.nw already into the Popcorn-Time binary. The default nw binary does not work on NixOS, so that's why it fails to run :'(.

Splitting the Popcorn-Time binary into its original nw and package.nw would be one possiblity. I just don't know at what exact byte to split them (how big is the nw that popcorntime used?).

Another possiblity is using the source-based variant of this package (https://github.com/bobvanderlinden/nixpkgs/tree/popcorntime-source) and use that to create package.nw.

@MasseGuillaume
Copy link
Contributor Author

Hum the source based approach make sense. Is it working ?

Is there a way to build ffmpedsumo? Look like chromium could also benefit from it: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/chromium/browser.nix#L16

@MasseGuillaume
Copy link
Contributor Author

I updated your branch to 0.8.3-0: MasseGuillaume@fdbf4c9

Two main issues

video js: No compatible source was found for this video

[20114:0713/154846:INFO:CONSOLE(43)] ""[%cINFO%c] Watching:" "color: blue;" "color: black;" "Home"", source: app://host/src/app/app.js (43)
[20114:0713/154846:INFO:CONSOLE(53)] ""%c[%cERROR%c] TypeError: Cannot call method 'off' of undefined" "color: black;" "color: red;" "color: black;" "TypeError: Cannot call method 'off' of undefined\n    at Backbone.Marionette.ItemView.extend.onShow (app://host/src/app/lib/views/player/player.js:208:30)\n    at Object.eval [as _triggerMethod] (app://host/src/app/vendor/marionette/lib/backbone.marionette.js:685:25)\n    at Marionette.View.Backbone.View.extend.triggerMethod (app://host/src/app/vendor/marionette/lib/backbone.marionette.js:1910:28)\n    at Object.Marionette.triggerMethodOn (app://host/src/app/vendor/marionette/lib/backbone.marionette.js:721:16)\n    at Marionette.Region.Marionette.Object.extend.show (app://host/src/app/vendor/marionette/lib/backbone.marionette.js:1182:20)\n    at Backbone.Marionette.LayoutView.extend.showPlayer (app://host/src/app/lib/views/main_window.js:456:25)\n    at executeBound (/tmp/node_modules/underscore/underscore.js:701:67)\n    at bound (/tmp/node_modules/underscore/underscore.js:716:14)\n    at triggerEvents (app://host/src/app/vendor/backbone/backbone.js:352:57)\n    at triggerApi (app://host/src/app/vendor/backbone/backbone.js:339:19)"", source: app://host/src/app/app.js (53)
[20114:0713/154846:INFO:CONSOLE(208)] "Uncaught TypeError: Cannot call method 'off' of undefined", source: app://host/src/app/lib/views/player/player.js (208)
[20114:0713/154846:INFO:CONSOLE(1409)] ""VIDEOJS:" "ERROR:" "(CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)" "No compatible source was found for this video." {"code":4,"message":"No compatible source was found for this video."}", source: app://host/src/app/vendor/video.js/dist/video-js/video.dev.js (1409)

The TV series tab does not work anymore (probably a bug in their code):

[16938:0713/153446:INFO:CONSOLE(0)] "body.scrollTop is deprecated in strict mode. Please use 'documentElement.scrollTop' if in strict mode and 'body.scrollTop' only if in quirks mode.", source:  (0)
[16938:0713/153446:INFO:CONSOLE(43)] ""[%cINFO%c] Spawning new provider" "color: blue;" "color: black;" "TVApi"", source: app://host/src/app/app.js (43)
[16938:0713/153446:INFO:CONSOLE(53)] ""%c[%cERROR%c] SyntaxError: Use of const in strict mode." "color: black;" "color: red;" "color: black;" "SyntaxError: Use of const in strict mode.\n    at exports.runInThisContext (vm.js:69:16)\n    at Module._compile (module.js:435:25)\n    at Object.Module._extensions..js (module.js:470:10)\n    at Module.load (module.js:352:32)\n    at Function.Module._load (module.js:308:12)\n    at Module.require (module.js:360:17)\n    at require (module.js:376:17)\n    at window.require (eval at undefined, \u003Canonymous\u003E:1:112)\n    at new TVApi (app://host/src/app/lib/providers/tvapi.js:10:22)\n    at Object.getProvider [as get] (app://host/src/app/lib/providers/generic.js:57:23)"", source: app://host/src/app/app.js (53)
[16938:0713/153446:INFO:CONSOLE(69)] "Uncaught SyntaxError: Use of const in strict mode.", source: vm.js (69)

@copumpkin
Copy link
Member

In general, I'd vote for a source-based package, as 99% of nixpkgs works that way and it has a few benefits.

@bobvanderlinden
Copy link
Member

@copumpkin This package is a bit trickier. It relies on npm, grunt and bower. These steps mostly download and bundles HTML/JS/CSS source code. The NixOS package just took the packaged HTML/JS/CSS and combines it with the nw binary that is in NixOS already, skipping the npm, grunt and bower steps. Maintaining the npm, grunt and bower steps was a bit of a pain, that's why we chose to use the binary (ie. pre-packaged) one.

@MasseGuillaume I'll give your version of the source package a try.

@sv244
Copy link

sv244 commented Jul 14, 2015

FYI: If your binary for nw.js is not one of version 0.12.1, then the application will not work properly. If the binary does not contain the right codecs, then playback of videos will fail.

And a fast search tells me that that NixOS uses nw.js 9 or 11.

@MasseGuillaume
Copy link
Contributor Author

@sv244 oh thanks. totally make sense!

what about the TV series tab? I did deleted the ~/.config/Popcorn-Time/ folder.

@bobvanderlinden
Copy link
Member

I had the same problems @MasseGuillaume mentioned. Also when I deleted ~/.config/Popcorn-Time, which also had no effect.
nwjs 12 could solve both problems. Next step would be to get nwjs 12 in nixpkgs. I'm trying this atm, we'll see how it goes.

@MasseGuillaume
Copy link
Contributor Author

@bobvanderlinden I was trying that right now :P.

Do you know how to find missing files. node-webkit is a big black box to me and having error messages like:

replacing old ‘node-webkit-0.11.2’
installing ‘node-webkit-0.12.2’
these derivations will be built:
  /nix/store/k43449b1gv43pjpjvj2rww077nxq046b-node-webkit-0.12.2.drv
building path(s) ‘/nix/store/blpkrk7dhv1rcy4bv79w4p305sypmbsf-node-webkit-0.12.2’
unpacking sources
unpacking source archive /nix/store/nbsifzfq2075gldn96w4kf2i9ryc41ka-nwjs-v0.12.2-linux-x64.tar.gz
source root is nwjs-v0.12.2-linux-x64
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
stat: No such file or directory

does not really help.

@bobvanderlinden
Copy link
Member

@MasseGuillaume I ran into the same problem. It's because nwjs_12 doesn't have nwsnapshot and instead has nwjc. I've got it build, but it doesn't run correctly yet. Here is the work in progress: https://github.com/bobvanderlinden/nixpkgs/tree/popcorntime-0.3.8

Edit: I get this as the error when running popcorntime:

29626:0714/214041:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[29626:0714/214041:FATAL:udev_loader.cc(36)] Check failed: false. 
ATTENTION: default value of option force_s3tc_enable overridden by environment.

@MasseGuillaume
Copy link
Contributor Author

great. I think strace can be usefull to debug missing files.

@bobvanderlinden
Copy link
Member

Good one. It seems to be loading nw.pak before logging Running without the SUID sandbox. Not sure if that's related.

@sv244
Copy link

sv244 commented Jul 14, 2015

The SUID error: nwjs/nw.js#2699

@bobvanderlinden
Copy link
Member

@sv244 Thanks, that saved me of unnecessary searching.

Running nwjs without popcorntime works correctly, but it does still it'll result in:

[30619:0714/214827:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
ATTENTION: default value of option force_s3tc_enable overridden by environment.

So, both of these can be ignored. The problem is with:

[29626:0714/214041:FATAL:udev_loader.cc(36)] Check failed: false. 

@MasseGuillaume
Copy link
Contributor Author

@bobvanderlinden
Copy link
Member

Ok, it was indeed missing libudev. I found a workaround that was used in Spotify's package and used a similar approach: bobvanderlinden@2df5322

It now seems to be working, video as well as the tv shows tab!

@MasseGuillaume
Copy link
Contributor Author

haha omg I'm looking at this file right now ;-)

@MasseGuillaume
Copy link
Contributor Author

@bobvanderlinden good news. testing now

@MasseGuillaume
Copy link
Contributor Author

@bobvanderlinden outch the sound does not work.

@bobvanderlinden
Copy link
Member

Hmm, it did here. What output do you get?

@MasseGuillaume
Copy link
Contributor Author

@bobvanderlinden does work in the trailer & movie. didn't work in TV series

@bobvanderlinden
Copy link
Member

Aah, hmm, you're right. It doesn't work here either. Do tv-shows use a different codec or need a different libffmpegsumo.so?

The only error I see when playing is:

[3833:0714/221128:INFO:CONSOLE(53)] ""%c[%cERROR%c] subtitleProvider.fetch()" "color: black;" "color: red;" "color: black;" "Unable to extract subtitle"", source: app://host/src/app/app.js (53)

But it seems to me that's unrelated.

@sv244 Could you shed some light on this?

@MasseGuillaume
Copy link
Contributor Author

It does work for some series

@bobvanderlinden
Copy link
Member

Hmm, ok. Since we're using Popcorntime's libffmpegsumo.so, I'd guess it does the same on Ubuntu/Debian. Just a guess, but I haven't tried this (no Ubuntu/Debian here).

@MasseGuillaume
Copy link
Contributor Author

It's not that bad I think I only saw old episode of Homeland not working.

@MasseGuillaume
Copy link
Contributor Author

I think you should send a PR and we can get it better from here. Currently we have a broken package :-S in master.

@bobvanderlinden
Copy link
Member

@MasseGuillaume indeed, I was also watching an old episode (never used popcorntime for tv-shows). Newer episodes do seem to work here too.

I've cleaned up the commits and did a PR: #8819

@sv244
Copy link

sv244 commented Jul 14, 2015

It depends on the audio codec. Not sure really. If its our libffmpegsumo.so then it should work.

What episode exactly?

@MasseGuillaume
Copy link
Contributor Author

@sv244 Homeland Season 1 for example.

@bobvanderlinden
Copy link
Member

@sv244 The walking dead season 1 episode 1

@sv244
Copy link

sv244 commented Jul 15, 2015

The Walking Dead S01E01 720p gives me VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) The video playback was aborted due to a corruption problem or because the video used features your browser did not support., 480p should work fine. The videojs problem is common for some video files.

(OS X 10.10, so not real Linux ^^)

I don't have a 'Homeland Season 1' at the moment..

@bobvanderlinden
Copy link
Member

@sv244 ok, as long as it's not a packaging problem it's alright.

@MasseGuillaume
Copy link
Contributor Author

Ops I meant Homeland S02.

@joachifm
Copy link
Contributor

joachifm commented Apr 3, 2016

Closing. If you're having trouble violating copyright, that's not an issue for the NixOS project, IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants