mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-04-30 01:34:25 +02:00
Patch for Shaka-pakager files name
Patch for specials charset (Decryption returned a non-zero exit code.) Add coding: utf-8 (line 1) Add small list of characters (line 1028)
This commit is contained in:
parent
962904abd6
commit
6f9919ab9d
6
main.py
6
main.py
@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import argparse
|
||||
import glob
|
||||
import json
|
||||
@ -1021,8 +1022,11 @@ def decrypt(kid, in_filepath, out_filepath):
|
||||
|
||||
def handle_segments(url, format_id, video_title, output_path, lecture_file_name, chapter_dir):
|
||||
os.chdir(os.path.join(chapter_dir))
|
||||
|
||||
file_name = lecture_file_name.replace("%", "")
|
||||
# for french language among others, this characters cause problems with shaka-packager resulting in decryption failure
|
||||
# https://github.com/Puyodead1/udemy-downloader/issues/137
|
||||
# Thank to cutecat !
|
||||
file_name = file_name.replace("é", "e").replace("è", "e").replace("à", "a").replace("À", "A").replace("à", "a").replace("Á", "A").replace("á", "a").replace("Â", "a").replace("â", "a").replace("Ã", "A").replace("ã", "a").replace("Ä", "A").replace("ä", "a").replace("Å", "A").replace("å", "a").replace("Æ", "AE").replace("æ", "ae").replace("Ç", "C").replace("ç", "c").replace("Ð", "D").replace("ð", "o").replace("È", "E").replace("è", "e").replace("É", "e").replace("Ê", "e").replace("ê", "e").replace("Ë", "E").replace("ë", "e").replace("Ì", "I").replace("ì", "i").replace("Í", "I").replace("í", "I").replace("Î", "I").replace("î", "i").replace("Ï", "I").replace("ï", "i").replace("Ñ", "N").replace("ñ", "n").replace("Ò", "O").replace("ò", "o").replace("Ó", "O").replace("ó", "o").replace("Ô", "O").replace("ô", "o").replace("Õ", "O").replace("õ", "o").replace("Ö", "o").replace("ö", "o").replace("œ", "oe").replace("Œ", "OE").replace("Ø", "O").replace("ø", "o").replace("ß", "B").replace("Ù", "U").replace("ù", "u").replace("Ú", "U").replace("ú", "u").replace("Û", "U").replace("û", "u").replace("Ü", "U").replace("ü", "u").replace("Ý", "Y").replace("ý", "y").replace("Þ", "P").replace("þ", "P").replace("Ÿ", "Y").replace("ÿ", "y").replace("%", "")
|
||||
# commas cause problems with shaka-packager resulting in decryption failure
|
||||
file_name = file_name.replace(",", "")
|
||||
file_name = file_name.replace(".mp4", "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user