Hello, rookie here,
I manually download the .mpd file using yt-dlp, best-video.mp4, and best-audio.m4a
Then I decrypt them using mp4decrypt
Lastly, I join them using ffmpeg
Is there any way to do all these things automatically?
So that when I put the .mpd url and decryption key the remaining steps get completed automatically and produce the final output video.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
-
See https://forum.videohelp.com/threads/407216-Decryption-The-Dungeon-of-Despair especially the second post for examples. A few other users here are posing scripts too. Look at them and adapt to your own needs
-
-
-
-
I did compose this python script yonks ago. It's fairly generic: but it automatically does what you do. You run it. It asks for mpd. It'll download bestvideo & bestaudio using yt-dlp (of course, it does not select if best audio has AD, etc.), it'll ask for KEY#. Then it decrypts. It asks what name do you want to give file (yes, you can include spaces). then it'll place the decrypted file in a folder called Completed within the same folder that your python file resides:
Code:####version (20230205-1) do checks for dupe filename and illegal characters ####version (20230129-1) replace aria2c with -N 6 ####version (20221117-1) #### remove y/n option to remove crap (it auto removes it now) #### use shutil for moving crap to ./Throwaway and for removing ./Throwaway and its contents #### allow you to call final file name to include spaces #### at the end, it will now delete the Throwaway folder import os import shutil import glob ##########useful when used within VS Code to tell it which directory you're in abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dname) ########## def cls(): # posix is os name for Linux or mac if(os.name == 'posix'): os.system('clear') # clear is the bash command # else screen will be cleared for windows (os name is actually nt for Windows) else: os.system('cls') # cls is the batch command def filename(): output_name = input("What do you want to call your final file? (do not include file .extension like .mp4) ") output_name = f"{output_name}.mp4" path = f"./Completed/{output_name}" # look to see if duplicate filename if os.path.isfile(path): print(f"\nyou already have a file called {output_name}. Choose another name\n") return filename() #look to see if any illegal characters in filename illegals = "@$%\/:*?\"<>|~`#^+=\{\};!" any_illegals = (set(output_name) & set(illegals)) if not any_illegals: return output_name else: list_illegals = ' '.join(any_illegals) print(f"\nyou have included the following which are not legal characters: {list_illegals}\n") return filename() os.system('cls') print("\n\n") mpd_url = input("what is mpd URL? ") os.system(f'yt-dlp --allow-u -f bestvideo -N 6 "{mpd_url}" -o encryptVid.mp4') os.system(f'yt-dlp --allow-u -f bestaudio -N 6 "{mpd_url}" -o encryptAud.m4a') key = input("\n\nwhat is the KEY? ") print("==============================\n\n Decrypting\n\n==============================") os.system(f"mp4decrypt --show-progress --key 1:{key} encryptVid.mp4 video_decrypt.mp4") os.system(f"mp4decrypt --show-progress --key 1:{key} encryptAud.m4a audio_decrypt.m4a") if not os.path.exists("Throwaway"): os.makedirs("Throwaway") if not os.path.exists("Completed"): os.makedirs("Completed") print("\n\n\n\n") output_name = filename() os.system(f"ffmpeg -i video_decrypt.mp4 -i audio_decrypt.m4a -c:v copy -c:a copy mux_file.mp4") os.rename("mux_file.mp4", f'{output_name}') shutil.move(f'{output_name}', "./Completed") for data in glob.glob("*_decrypt*.*"): shutil.move(data,"./Throwaway") for data in glob.glob("encrypt*.*"): shutil.move(data,"./Throwaway") shutil.rmtree("./Throwaway") print(f"All done.\n\n Your final file '{output_name}' is in 'Completed' folder")
-
Similar Threads
-
mp4decrypt not work
By lfybbk10 in forum Video Streaming DownloadingReplies: 30Last Post: 15th Mar 2024, 16:54 -
MP4Decrypt plugin for yt-dlp
By pratikpatel8982 in forum Video Streaming DownloadingReplies: 14Last Post: 12th Sep 2023, 04:22 -
Mp4decrypt error
By Av4K100 in forum Video Streaming DownloadingReplies: 5Last Post: 1st Feb 2023, 15:56 -
Mp4decrypt syntax
By dzigelbaum in forum Video Streaming DownloadingReplies: 5Last Post: 26th Mar 2022, 01:23 -
Does YT-DLP or FFMPEG Merge The Raw Encrypted Fragments
By SoConfused in forum Video Streaming DownloadingReplies: 1Last Post: 14th Jun 2021, 16:21