VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 29 of 29
  1. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Why?

    Image
    [Attachment 64382 - Click to enlarge]


    In the New Year Termux found me! Termux - a Terminal Emulator that runs on Android, is for all intents and purposes, a full blown Linux environment that runs sweetly on your Android. It is installed from the F-Droid catalogue of free and open source software. Find it at f-droid.org and install.

    In the F-droid app search for Termux - there are a few entries - but download and install 'Termux' - the one that says terminal emulator.
    There are several places to get help installing Termux - start looking on reddit.com/r/Termux or https://discord.gg/termux-641256914684084234

    To avoid confusion in the description below - phone code looks like this:-
    This is written in the terminal emulator screen
    And your PC instructions look like this:-
    Code:
    This is typed on your PC
    First you'll want to set up house in termux:
    pkg update & upgrade
    termux-setup-storage
    pkg install openssl openssh
    pkg install python3
    pkg install python-cryptography
    pkg install ffmpeg libxml2 libxslt
    pip install wheel requests yt-dlp bs4 google lxml protobuf==3.20.3 pycryptodomex # as a start
    You now have a basic working environment. If you
    pwd
    Termux responds with /data/data/com.termux/files/home/ from here I set up a directory
    mkdir ~/python
    ./bin already exists but note:- these are local and different from the system location /data/data/com.termux/files/usr/bin/ - we will later use this location to put some decryption binaries in as they will then be in the PATH and can be called from anywhere within termux.

    As for getting decryption onto your phone I am assuming you have a working CDM; although you could set up code to call getwvkeys api and get keys from Notaghost's server. [EDIT] Notaghost's server is practically unavailable; the site Admin doesn't appear like new people using the service.[/EDIT]

    Getting stuff on your phone is easy. cable connect and set-up permission for file transfer.

    'adb push / pull' works for me but you could use your PC file manger to drop what you need to your phone sdcard.
    Code:
    adb push ./WKS-KEYS  /sdcard/
    sends the whole directory and sub-folders to your phone. If it works on your PC it will work on your phone.

    From here on we need proper access to your phone from a terminal on your PC so we can work more easily.
    On your phone and in termux set up an access password
    passwd
    find out who you are:
    whoami
    will respond with something like u0_a100
    start the secure shell daemon on your phone with
    sshd
    From your PC
    Code:
    ssh -p8022 u0_a100@<phone-IP-address>
    Now you have a link to your phone it is more easy to configure.
    NOTE: from now on TYPING IS IN A TERMINAL ON YOUR PC LINKED TO YOUR PHONE
    anything you type here will execute on your phone.
    mv ~/storage/shared/WKS-KEYS ~/python/
    brings your cdm etc in to Termux plus any scripts you use to download. They will all work. Maybe you'll need to change file-save locations but simple script editing can be done from your ssh link to your phone using a text editor like nano or vim.

    Decryption uses some of Bento4 Tools binaries and they are here https://files.videohelp.com/u/301890/bento4_tools_android.zip
    unzip and move to your sdcard. I only moved mp4decrypt as I would not be using any other of Bento4 binaries on my phone. Copy to your phone with adb or file-manager

    Once the binary is in the root folder of your SD card
    mv ~/storage/shared/mp4decrypt /data/data/com.termux/files/usr/bin/
    moves it safely to the /usr/bin.

    give execute permissions and check it is working:-
    chmod +x /data/data/com.termux/files/usr/bin/mp4decrypt
    mp4decrypt
    Image
    [Attachment 64387 - Click to enlarge]


    Termux has a simply wonderful facility to accept a shared piece of text or url!! So if I touch a url in my phone's browser window it can be shared to Termux.
    In bin I have a file with execute privileges (chmod +x filename) called termux-url-opener - this is special name Termux recognises. Termux shares automatically to this file. When run it calls python/opener.py which is a menu program
    Code:
    #!/bin/bash
    python  ~/python/opener.py
    which is a menu program
    Image
    [Attachment 64390 - Click to enlarge]


    Now sharing can only pass one argument. Some of my scripts use two or three. No matter; adapt your opening routine to use the first argument but wait for input on the others.
    So calling STV (and similar mpd - tg4.ie -uktvplay) I shared the mpd and entered the menu.

    The code called by the menu waits for further input. So my progam entry point looks like this and allows a hybrid of command line and input commands.
    Code:
    if __name__ == '__main__':
        from sys import argv
        if argv and len(argv) > 1:
            mpdurl = argv[1]
            try:
                videoname=argv[2]
            except:
                # 2nd arg missing
                videoname = input("Videoname: ")
        else:
            mpdurl = input("Enter the mpd to download:  ")
            videoname = input("\nEnter the filename to save\n.mp4 will be added:  ")
            print(f"{mpdurl}  , {videoname}")
        getVideo(mpdurl, videoname)
    Getting the mpd is easy. Using Kiwi-browser on your phone, install 'developer-tools' extension if not present already. kiwi browser is an adapted chrome browser so it can run chrome's extensions without the Chrome Police looking over your shoulder.

    In use, start a web page with your target video; select 'developer tools' from the browser menu. It opens another tab; start and stop the video; change tab; select the manifest et voila!
    Image
    [Attachment 64391 - Click to enlarge]


    Sharing an mpd can be a bit of a fiddle. We need the manifest as a url link in kiwi-browser to share.

    Click on the manifest and in the pop-up choose Open in new tab (the top item).

    Image
    [Attachment 64393 - Click to enlarge]


    long press to share -

    Image
    [Attachment 64392 - Click to enlarge]
    Image
    [Attachment 64394 - Click to enlarge]


    Sometimes I will cheat and find an mpd from my PC and get it onto my phone with
    Code:
     qrencode -o qr.png  "some video manifest"
    that produces a qr code your phone can read and share to termux.
    Image
    [Attachment 64395 - Click to enlarge]

    I am quite new to decryption. Living in the UK I was able to use my phone to download lots of UK free-to-air stuff as I was learning python and Termux. That is how I started to use my phone to download. The BBC and some other UK channels have series links. I pass a series url to my phone and it downloads the whole lot.

    I save them, on the phone, at ~/storage/downloads/UKTV/ (note the 's' on downloads it differentiates file manager and Termux) The programmes are now visible to my phone file manager.

    Termux will run rsync (pkg install rsync)

    Then the command from termux
    rsync -tuv ~/storage/downloads/UKTV/*.mp4 angela@192.168.1.25:/hdd/movie/Z-incoming/
    will copy to my satellite DVR (or NAS or wherever) I did play around setting up password free access by sharing public keys between boxes but that is not for here.

    So generally I develop and test from my PC and transfer the python scripts to my phone. Any small changes can be made in situ with nano. But bigger stuff comes back to my PC again.

    One gotcha I found was downloading DRM stuff with a script which complained it could not find any SSL certificates. I had Adguard on my phone running that sets up a local vpn to intercept traffic. I halted that and all was well.

    And a second gotcha: if you have errors in your code and the code is being called by another program - url sharing for example - when the error happens the calling program closes and clears the screen of all the useful error reports. It all happens in a flash - so at the end of your main function put a 'time.sleep(5) to give you a chance to see what is happening. It can be edited up or down to suit your need.

    Except errors and omissions that's it folks; that is all I know!
    Last edited by A_n_g_e_l_a; 17th Nov 2023 at 07:03. Reason: various edits to match more recent Termux version needs
    Quote Quote  
  2. Excellent A_n_g_e_l_a

    Thanks for sharing
    Quote Quote  
  3. Well written detailed explanation.....thanks for sharing
    Quote Quote  
  4. Member
    Join Date
    Sep 2021
    Location
    Los Angeles
    Search PM
    As far as I understand, this can be achieved only if the phone will be available, which means that remotely they can not hack anything. I have heard that hackers hack into various data through the phone network, as it is very unprotected, which means that it is only a matter of time before the data is retrieved. I, for example, in order to avoid this incident, use VoIP numbers from https://usechalkboard.com, because they are tied to the Internet network, which would be much harder to hack, or impossible at all.
    Last edited by Bvgary; 8th Sep 2022 at 06:57.
    Quote Quote  
  5. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Bvgary View Post
    everything is very complicated.
    Nah! Work at it.
    Quote Quote  
  6. Nice Share.
    discord=notaghost9997
    Quote Quote  
  7. mv ~/storage/shared/WKS-KEYS ~/python/
    for the name of my android mobie root menu,

    ~/storage/shared/

    how can i know my excatly root menu name,
    for instant, my oneplus 5t, i use file manager, it names internal storage,
    i tried mv ~/storage/internal storage/WKS-KEYS ~/python/, mv ~/storage/internalstorage/WKS-KEYS ~/python/, mv ~/internal storage/WKS-KEYS ~/python/, mv ~/internalstorage/WKS-KEYS ~/python/
    none of them work. said No such file or directory.
    i already confirm that the folder python folder exist in the layer of /data/data/com.termux/files/home,
    i used CD enter the layer.

    thank you
    Last edited by missdgsn; 4th Sep 2022 at 08:36.
    Quote Quote  
  8. psaframe
    Join Date
    Mar 2021
    Location
    Algeria
    Search PM
    Awsome work. thanks for share man!
    Quote Quote  
  9. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by missdgsn View Post
    mv ~/storage/shared/WKS-KEYS ~/python/
    for the name of my android mobie root menu,

    ~/storage/shared/

    how can i know my excatly root menu name,
    for instant, my oneplus 5t, i use file manager, it names internal storage,
    i tried mv ~/storage/internal storage/WKS-KEYS ~/python/, mv ~/storage/internalstorage/WKS-KEYS ~/python/, mv ~/internal storage/WKS-KEYS ~/python/, mv ~/internalstorage/WKS-KEYS ~/python/
    none of them work. said No such file or directory.
    i already confirm that the folder python folder exist in the layer of /data/data/com.termux/files/home,
    i used CD enter the layer.

    thank you
    In Termux
    type
    cd ~/; pwd
    You get /data/data/com.termux/files/home

    Now type
    cd /; pwd
    And you'll get / ... which is the root of Termux.

    Neither have any relevance to the Android system folders. Think of Termux as being an emulator running in its own sandbox with a link to files only on the /sdcard/ of the Android system.

    i tried mv ~/storage/internal storage/WKS-KEYS ~/python/, mv ~/storage/internalstorage/WKS-KEYS ~/python/, mv ~/internal storage/WKS-KEYS ~/python/, mv ~/internalstorage/WKS-KEYS ~/python/
    Not sure why you are using 'internal storage' try
    Code:
    mv ~/storage/shared/WKS-KEYS ~/python/
    Quote Quote  
  10. Member
    Join Date
    Sep 2021
    Location
    Los Angeles
    Search PM
    I've also heard that connecting a VoIP number can make it difficult to decrypt the phone. Generally, the benefits of these numbers are very strong, as not only can you call another country without any problems, but you can also secure your data by simply linking your account to a VoIP number. I personally use a similar number from https://www.mightycall.com/ and I can say that it is very convenient and not expensive, so I recommend it.
    Last edited by pristick; 1st Nov 2022 at 13:41.
    Quote Quote  
  11. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by pristick View Post
    This is code for some program.
    Big Chief not read post?

    This guide Big-Chief make copy phone video.


    I can't say plainer than that.
    Quote Quote  
  12. I won't use it but I want to thank Angela for his another wonderful guide.

    Beginners must read such guides instead of sending private messages.
    Quote Quote  
  13. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by ridibunda View Post
    I won't use it but I want to thank Angela for his another wonderful guide.
    ...
    How kind you are Sir.... But... and I don't know how to break it to you..... except to say I am a female of the species, and a grey and wrinkly one at that.
    Quote Quote  
  14. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by ridibunda View Post
    I won't use it but I want to thank Angela for his another wonderful guide.
    ...
    How kind you are Sir.... But... and I don't know how to break it to you..... except to say I am a female of the species, and a grey and wrinkly one at that.
    Sorry then.

    Keep up the good work.
    Quote Quote  
  15. Member
    Join Date
    Mar 2023
    Location
    Asia
    Search Comp PM
    Hey, this sounds dumb but, do i need too root my phone? I'm trying to install mp4decrypt and aria2c. I install yt-dlp via pip, could i install mp4decrypt&aria2c via pip also?
    Quote Quote  
  16. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Groyo View Post
    Hey, this sounds dumb but, do i need too root my phone?
    Ho! No. Termux is a virtual environment and within that environment Termux behaves as rooted Linux. It does not need the phone rooted.
    Originally Posted by Groyo View Post
    I'm trying to install mp4decrypt and aria2c. I install yt-dlp via pip, could i install mp4decrypt&aria2c via pip also?
    No they are not scripts written in python but are independent programs that run from the shell (bash), follow instructions above and place them in the system bin folder. Make sure you use program versions compiled for your phone.
    Aria2c: It is debatable whether you still need it to multi-thread downloads. yt-dlp now has it's own built in muli-threading - just use -N 8 as a yt-dlp option (8 indicates the maximum threads - any number can be chosen up to 8). But of course - your preference.

    The World has turned since the above post was written and I have now discovered N_m3u8DL-RE and shaka-packager can do the downloaded, decrypting and muxing files together in one command.. See Decryption-The-Last-Crusade for details.
    Last edited by A_n_g_e_l_a; 5th Mar 2023 at 03:56.
    Quote Quote  
  17. I don't use android (except the device that so graciously donated its private key) - but this is well done tutorial.

    Thanks for your work here.
    Quote Quote  
  18. Originally Posted by A_n_g_e_l_a View Post
    Why?

    termux-set-up storage
    pkg update & upgrade
    pkg install openssl openssh
    pkg install python3
    pkg install ffmpeg libxml2 libxslt
    pip install wheel requests yt-dlp bs4 google lxml protobuf==3.20.3 pycryptodomex # as a start
    termux-set-up storage
    is not a valid command.
    Quote Quote  
  19. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by thejaceman View Post
    Originally Posted by A_n_g_e_l_a View Post
    Why?

    termux-set-up storage
    pkg update & upgrade
    pkg install openssl openssh
    pkg install python3
    pkg install ffmpeg libxml2 libxslt
    pip install wheel requests yt-dlp bs4 google lxml protobuf==3.20.3 pycryptodomex # as a start
    termux-set-up storage
    is not a valid command.
    No it isn't, but its close!! Its missing a hyphen https://wiki.termux.com/wiki/Termux-setup-storage
    Quote Quote  
  20. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by thejaceman View Post
    Originally Posted by A_n_g_e_l_a View Post
    Why?

    termux-set-up storage
    pkg update & upgrade
    pkg install openssl openssh
    pkg install python3
    pkg install ffmpeg libxml2 libxslt
    pip install wheel requests yt-dlp bs4 google lxml protobuf==3.20.3 pycryptodomex # as a start
    termux-set-up storage
    is not a valid command.
    No it isn't, but its close!! Its missing a hyphen https://wiki.termux.com/wiki/Termux-setup-storage
    Looks like instead of missing, it's in the wrong location.

    The correct command is:

    Code:
    termux-setup-storage
    Quote Quote  
  21. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by thejaceman View Post

    Looks like instead of missing, it's in the wrong location.
    Yes its a typo - thanks I'll correct it.
    Quote Quote  
  22. Search, Learn, Download! Karoolus's Avatar
    Join Date
    Oct 2022
    Location
    Belgium
    Search Comp PM
    Originally Posted by A_n_g_e_l_a View Post
    As for getting decryption onto your phone I am assuming you have a working CDM; although you could set up code to call getwvkeys api and get keys from Notaghost's server.
    Very nice!

    When I started reading this, I was hoping you'd just use the phone's CDM to request keys, which would have been a boss move! But still, very cool to see
    Quote Quote  
  23. Hi everyone, is this still working now? and I want to install python version 3.9.7 on termux, how to do?
    Quote Quote  
  24. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by googol View Post
    Hi everyone, is this still working now? and I want to install python version 3.9.7 on termux, how to do?
    tried pkg install python3.9.7? Tried a google search?
    Quote Quote  
  25. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by googol View Post
    Hi everyone, is this still working now? and I want to install python version 3.9.7 on termux, how to do?
    tried pkg install python3.9.7? Tried a google search?
    Thank you, I tried but didn't succeed. I will try again one more time.
    Quote Quote  
  26. How wonderful
    Last edited by H.x.s123; 1st Sep 2023 at 12:21.
    Quote Quote  
  27. Member
    Join Date
    Jan 2021
    Location
    Argentina
    Search PM
    Just to know: there is a way to get keys using an extension like the old Widevine Guesser/Widevine Decryptor in Kiwi Browser without needing to dump a cdm or root the device?
    Quote Quote  
  28. yes, available. but not free

    and for everyone: please don't ask me about this trough PM. i don't have and i don't share any other info about that
    Quote Quote  
  29. Member
    Join Date
    Jan 2021
    Location
    Argentina
    Search PM
    Originally Posted by lomero View Post
    yes, available. but not free

    and for everyone: please don't ask me about this trough PM. i don't have and i don't share any other info about that
    I understand. Thanks for the answer, it was a question I had.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!