-
Notifications
You must be signed in to change notification settings - Fork 17
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
Can't control output sound from system volume control #18
Open
aanze
wants to merge
30
commits into
HenningThiemann:master
Choose a base branch
from
monkaBlyat:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e304a49
Update Dockerfile
monkaBlyat 1c2c4b1
Update README.md
monkaBlyat 09973dd
Update README.md
monkaBlyat d4715f2
Update README.md
monkaBlyat 46a4f98
Update README.md
monkaBlyat 6279f98
Update README.md
monkaBlyat 26e623c
Update README.md
monkaBlyat 8b29ae3
Update README.md
monkaBlyat aa49200
Update README.md
monkaBlyat 83bfcd9
Update README.md
monkaBlyat 8d46973
Update README.md
monkaBlyat 49aea89
Update Dockerfile
monkaBlyat 0fc87e3
Update Dockerfile
monkaBlyat c8053d1
Add files via upload
monkaBlyat e91dbfc
Add files via upload
monkaBlyat 5d49a16
Update chromium-armhf
monkaBlyat 47b17d7
Update README.md
monkaBlyat b9ea526
Update README.md
monkaBlyat 7e9464e
Update chromium-armhf
monkaBlyat f5d4306
Update README.md
monkaBlyat d68d355
Delete chromium.desktop
monkaBlyat 802441f
Add files via upload
monkaBlyat 192a1fd
Delete Chromium-Armv7.desktop
monkaBlyat c797fe0
Add files via upload
monkaBlyat 4e585bd
Add files via upload
monkaBlyat ee576c2
Update Chromium-Armv7.desktop
monkaBlyat bfb35c0
Update Dockerfile
monkaBlyat 986913b
Update Dockerfile
monkaBlyat 33b112b
Update Dockerfile
monkaBlyat 1272ffe
test
monkaBlyat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Desktop Entry] | ||
Encoding=UTF-8 | ||
Version=1.0 | ||
Type=Application | ||
Terminal=true | ||
Exec=sudo /usr/local/bin/chromium-armhf | ||
Name=Chromium Docker | ||
GenericName=Web Browser | ||
Comment=Browser for Netflix, Amazon and Spotify | ||
Icon=/home/pi/.themes/chromium.jpg | ||
Categories=Network;WebBrowser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,10 @@ Currently, it provides widevine CDM support. | |
## Build | ||
To build the application, you have to clone it first, | ||
``` | ||
git clone | ||
sudo apt install docker docker.io pulseaudio-utils pulseaudio | ||
git clone https://github.com/monkaBlyat/docker-chromium-armhf | ||
cd docker-chromium-armhf | ||
docker build -t hthiemann/chromium-armhf . | ||
sudo docker build -t hthiemann/chromium-armhf . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an anti-pattern to run docker via sudo. You should add your user to the docker-users group instead https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user |
||
``` | ||
|
||
## Run the container: | ||
|
@@ -19,29 +20,12 @@ If the xhost command can not be found, make sure to install it first (on manjaro | |
|
||
Although not required, it is recommended to save chromium settings in a volume, to make it persistent through container restarts. | ||
``` | ||
docker volume create chromium_home | ||
sudo docker volume create chromium_home | ||
``` | ||
After creating the volume, you can run the image using the following command: | ||
``` | ||
docker pull hthiemann/docker-chromium-armhf | ||
|
||
docker run --rm --privileged \ | ||
-e DISPLAY=unix$DISPLAY \ | ||
-v chromium_home:/home \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-v /dev:/dev -v /run:/run \ | ||
-v /etc/machine-id:/etc/machine-id \ | ||
--ipc=host \ | ||
--device /dev/dri \ | ||
--group-add video \ | ||
hthiemann/docker-chromium-armhf | ||
``` | ||
Or simply use the script chromium-armhf: | ||
``` | ||
sudo install -m 755 chromium-armhf /usr/local/bin | ||
sudo docker pull hthiemann/docker-chromium-armhf | ||
sudo cp chromium-armhf /usr/local/bin | ||
sudo usermod -aG docker $(whoami) | ||
chromium-armhf | ||
``` | ||
|
||
## Known Bugs | ||
- HW accelaration not working (check chrome://gpu) | ||
- Settings Tab crashed directly after loading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 truedread | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# netflix-1080p | ||
Chrome extension to play Netflix in 1080p and 5.1 | ||
|
||
# How it works | ||
|
||
The core of Netflix playback lies in JavaScript: specifically its "cadmium playercore" JS. The way Netflix (poorly) enforces 1080p to only be played back on ChromeOS devices is through these lines of JavaScript: | ||
|
||
```javascript | ||
a = /CrOS/.test(a.userAgent); | ||
this.Fma = this.Aw = q.Gu.PV; | ||
this.Qm = [x.$l.nV]; | ||
this.oo = [x.V.vA, x.V.wA]; | ||
a && this.oo.push(x.V.TH); | ||
``` | ||
|
||
What it is doing is testing your User-agent for the "CrOS" string anywhere in it. If the search returns true, it appends the 1080p profile to the profile playback array (what this line `a && this.oo.push(x.V.TH);` is doing). If it returns false, it does nothing. The playback profile array is set up like so: `this.oo = [x.V.vA, x.V.wA];`, x.V.vA is the SD profile and x.V.wA is the 720p profile. | ||
|
||
After reading this you think the easy solution would be to just change the User-agent to make it contain the string "CrOS" right? Not that simple. ChromeOS apparently has a different DRM implementation than chrome, even though both use Widevine. I could never get it to work when I tried, Netflix always threw license errors. The next easiest thing to do is just delete the conditional to append 1080p and just make the 1080p profile apart of the regular profiles (`this.oo = [x.V.vA, x.V.wA];` -> `this.oo = [x.V.vA, x.V.wA, x.V.TH];`). This works perfectly, but only for the majority of Netflix content. A few videos, like Disney movies, have manifests completely restricted to Edge to the point where you can't obtain them without an Edge ESN. | ||
|
||
So, the next problem is how do you get an Edge manifest within Chrome? That's what I attempted to do with `get_manifest.js`, which is a Netflix MSL client written entirely in JavaScript (essentially my [pymsl](https://github.com/truedread/pymsl) library ported to JS). Of course there already an MSL client in JavaScript: the playercore. But since it's so heavily obfuscated, it was easier to rewrite one myself. The new mod has this snippet of code: | ||
|
||
```javascript | ||
var f = c.HS.viewables[0]; | ||
if (/watch/.test(window.location.pathname)) { | ||
var edgeLocked = true; | ||
|
||
for (var i = 0; i < f.videoTracks[0].downloadables.length; i++) { | ||
if (f.videoTracks[0].downloadables[i].contentProfile == "playready-h264mpl40-dash") { | ||
edgeLocked = false; | ||
break; | ||
} | ||
} | ||
|
||
if (edgeLocked) { | ||
console.log("Manifest locked to Edge (or not available in 1080p)"); | ||
console.log("Getting Edge manifest"); | ||
var manifest = await getManifest(); | ||
console.log("Acquisition successful, commence playback"); | ||
var edge_manifest = manifest.result.viewables[0]; | ||
edge_manifest.playbackContextId = f.playbackContextId; | ||
edge_manifest.drmContextId = f.drmContextId; | ||
f = edge_manifest; | ||
} | ||
} | ||
``` | ||
|
||
What this new snippet of code does is test if the current page is a /watch/ URL, and if so check the Chrome manifest to see if a 1080p profile is already included. If so, commence playback like normal. If not, call `getManifest()` from `get_manifest.js` and replace the `playbackContextId` and `drmContextId` from the Edge manifest with values from the Chrome manifest. This is for license acquisition: those values are for the MSL server to maintain a persistent session between manifest acquisition and license acquisition. If you use an Edge `playbackContextId` and `drmContextId`, you'll be unable to obtain a Widevine license for Chrome. After all those operations are performed, playback is resumed like normal. | ||
|
||
All the Chrome extension has to do is redirect all requests to Netflix's playercore to the modified one it has in the root directory. ~~That's it. A two line modification.~~ What was once a two line modification has turned into a giant project to cover all the bases in 1080p playback. | ||
|
||
# Why? | ||
|
||
Why not. | ||
|
||
# Notes | ||
|
||
- Chrome Webstore link: https://chrome.google.com/webstore/detail/netflix-1080p/cankofcoohmbhfpcemhmaaeennfbnmgp | ||
- This may raise your CPU usage since Netflix was never intended to be played back in 1080p on Chrome. See [this](https://github.com/truedread/netflix-1080p/issues/15#issuecomment-398256248) comment for more details. | ||
- Make sure to clear your browser cache, as the cached playercore will override the modified one and you will not be able to play 1080p. | ||
- On videos where Edge manifest acquisition is needed (the console will say so), initial loading may take 5 seconds longer due to two manifests needing to be obtained. | ||
|
||
# Donate | ||
|
||
I'm still a student, so if you could help me out and buy me a cup of coffee it would support my future projects and development on this extension! Please note that donating is completely optional; this extension is free and will remain free forever. | ||
|
||
- BTC: 1CqGMe6skpNQGSmm7uEtSrVfAUo59fYBnM | ||
- ETH: 0x87053e321B3a4b94c6c38e6A062bF91649285452 | ||
- Ko-fi: https://ko-fi.com/truedread | ||
|
||
Thanks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
chrome.webRequest.onBeforeRequest.addListener( | ||
function(details) { | ||
return { | ||
redirectUrl: chrome.extension.getURL("cadmium-playercore-6.0023.327.011-1080p.js") | ||
}; | ||
}, { | ||
urls: [ | ||
"*://assets.nflxext.com/*/ffe/player/html/*", | ||
"*://www.assets.nflxext.com/*/ffe/player/html/*" | ||
] | ||
}, ["blocking"] | ||
); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a relative path