diff --git a/.gitignore b/.gitignore index 9e3eb41..7a83070 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,13 @@ .idea/ /data/ /cache/ +.vscode/ *.log __pycache__ -ffmpeg.exe \ No newline at end of file +ffmpeg.exe +*.bat +HLSDownloader.exe +m3u8dl-windows-amd64.exe +manual command.txt +pdf_converter.py +vsd.exe \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d9f870b..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: Current File with Arguments", - "type": "debugpy", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal", - "args": [ - "-ds", - "-nv", - "-cnf", - "清华大学", - "-c", - "${input:cookie}" // Ask for cookie here - ] - } - ], - "inputs": [ - { - "id": "cookie", - "type": "promptString", - "description": "Enter the cookie", - "default": "cookie" - } - ] -} \ No newline at end of file diff --git a/HLSDownloader.exe b/HLSDownloader.exe deleted file mode 100644 index 3edebfe..0000000 --- a/HLSDownloader.exe +++ /dev/null Binary files differ diff --git a/m3u8dl-windows-amd64.exe b/m3u8dl-windows-amd64.exe deleted file mode 100644 index 4b290fa..0000000 --- a/m3u8dl-windows-amd64.exe +++ /dev/null Binary files differ diff --git a/manual command.txt b/manual command.txt deleted file mode 100644 index ec0a6d4..0000000 --- a/manual command.txt +++ /dev/null @@ -1 +0,0 @@ -ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "input.ts" -c:v hevc_nvenc -cq 28 -surfaces 64 -bufsize 12800k -r 7.5 -rc-lookahead 63 -c:a aac -ac 1 -rematrix_maxval 1.0 -b:a 64k "output.ts" -n -hide_banner -loglevel warning -stats \ No newline at end of file diff --git a/manual-video_proc.bat b/manual-video_proc.bat deleted file mode 100644 index 4661c6d..0000000 --- a/manual-video_proc.bat +++ /dev/null @@ -1,63 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -:: Set the input and output folders -set "input_folder=C:\Users\YLW-LAPTOP\Downloads\Video" -set "output_folder=C:\Users\YLW-LAPTOP\Downloads\video\Output" - -:: Ensure the output folder exists -if not exist "%output_folder%" ( - mkdir "%output_folder%" -) - -:: Change to the input folder -cd /d "%input_folder%" - -:: Initialize variables -set "current_group=" -set "concat_file=" - -:: Loop through all files with the .mp4 extension in the input folder -for %%F in (*.mp4) do ( - :: Extract the group prefix from the filename (e.g., 1 from 1-1.mp4) - for /f "tokens=1 delims=-" %%G in ("%%F") do ( - set "group_prefix=%%G" - - :: Check if we're still in the same group - if not "!group_prefix!"=="!current_group!" ( - :: If a previous group exists, process it - if defined current_group ( - :: Run ffmpeg with CUDA on the current group - ffmpeg -f concat -safe 0 -i "!concat_file!" ^ - -c:v hevc_nvenc -cq 28 -surfaces 64 -bufsize 12800k -r 7.5 -rc-lookahead 63 ^ - -c:a copy "%output_folder%\!current_group!_output.mp4" -n -hide_banner -loglevel warning -stats - - :: Clean up the temporary concat file - del "!concat_file!" - ) - - :: Start a new group and reset concat file - set "current_group=!group_prefix!" - set "concat_file=%output_folder%\!current_group!_concat.txt" - echo Creating concat file for group !current_group! - - :: Initialize the concat file for the new group - > "!concat_file!" echo file '%input_folder%\%%F' - ) else ( - :: Append the current file to the concat file - >> "!concat_file!" echo file '%input_folder%\%%F' - ) - ) -) - -:: Process the last group if needed -if defined current_group ( - ffmpeg -f concat -safe 0 -i "!concat_file!" ^ - -c:v hevc_nvenc -cq 28 -surfaces 64 -bufsize 12800k -r 7.5 -rc-lookahead 63 ^ - -c:a copy "%output_folder%\!current_group!_output.mp4" -n -hide_banner -loglevel warning -stats - del "!concat_file!" -) - -echo All videos processed! -endlocal -pause diff --git a/manual_process.bat b/manual_process.bat deleted file mode 100644 index 8a8749c..0000000 --- a/manual_process.bat +++ /dev/null @@ -1,64 +0,0 @@ -@echo off -chcp 65001 -setlocal enabledelayedexpansion - -:: Set the input and output folders -set "input_folder=INPUT_FOLDER" -set "output_folder=OUTPUT_FOLDER" - -:: Ensure the output folder exists -if not exist "%output_folder%" ( - mkdir "%output_folder%" -) - -:: Change to the input folder -cd /d "%input_folder%" - -:: Initialize variables -set "current_group=" -set "concat_file=" - -:: Loop through all files with the .mp4 extension in the input folder -for %%F in (*.mp4) do ( - :: Extract the group prefix from the filename (e.g., 1 from 1-1.mp4) - for /f "tokens=1 delims=-" %%G in ("%%F") do ( - set "group_prefix=%%G" - - :: Check if we're still in the same group - if not "!group_prefix!"=="!current_group!" ( - :: If a previous group exists, process it - if defined current_group ( - :: Run ffmpeg with CUDA on the current group - ffmpeg -f concat -safe 0 -i "!concat_file!" ^ - -c:v hevc_nvenc -cq 28 -surfaces 64 -bufsize 12800k -r 7.5 -rc-lookahead 63 ^ - -c:a copy "%output_folder%\!current_group!_output.mp4" -n -hide_banner -loglevel warning -stats - - :: Clean up the temporary concat file - del "!concat_file!" - ) - - :: Start a new group and reset concat file - set "current_group=!group_prefix!" - set "concat_file=%output_folder%\!current_group!_concat.txt" - echo Creating concat file for group !current_group! - - :: Initialize the concat file for the new group - > "!concat_file!" echo file '%input_folder%\%%F' - ) else ( - :: Append the current file to the concat file - >> "!concat_file!" echo file '%input_folder%\%%F' - ) - ) -) - -:: Process the last group if needed -if defined current_group ( - ffmpeg -f concat -safe 0 -i "!concat_file!" ^ - -c:v hevc_nvenc -cq 28 -surfaces 64 -bufsize 12800k -r 7.5 -rc-lookahead 63 ^ - -c:a copy "%output_folder%\!current_group!_output.mp4" -n -hide_banner -loglevel warning -stats - del "!concat_file!" -) - -echo All videos processed! -endlocal -pause diff --git a/pdf_converter.py b/pdf_converter.py deleted file mode 100644 index fe93608..0000000 --- a/pdf_converter.py +++ /dev/null @@ -1,59 +0,0 @@ -from PIL import Image -import os -import re - -def convert_images_to_pdf(folder_path): - # Iterate over each subfolder in the given folder - for subfolder in os.listdir(folder_path): - subfolder_path = os.path.join(folder_path, subfolder) - - # Only process directories (subfolders) - if os.path.isdir(subfolder_path): - print(f"Processing folder: {subfolder_path}") - - # Get all images in the subfolder (only .png, .jpg, .jpeg) - images = [] - for img in os.listdir(subfolder_path): - img_path = os.path.join(subfolder_path, img) - if img.lower().endswith(('.png', '.jpg', '.jpeg')): # Only consider image files - base_name = os.path.splitext(img)[0] # Get base name without extension - - # Check if a 'n-ans.*' file exists for the image 'n.*' - ans_image = f"{base_name}-ans{os.path.splitext(img)[1]}" - if ans_image in os.listdir(subfolder_path): - images.append(os.path.join(subfolder_path, ans_image)) - else: - images.append(img_path) - - if images: - # Sort images by numeric part of filename (ignoring '-ans' suffix) - images.sort(key=lambda x: int(re.match(r'(\d+)', os.path.splitext(os.path.basename(x))[0]).group(1))) - - # Open images and convert to PDF - image_list = [] - for img_path in images: - image = Image.open(img_path) - image = image.convert("RGB") # Convert to RGB for PDF compatibility - image_list.append(image) - - # Generate the PDF named after the subfolder - pdf_filename = f"{subfolder}.pdf" - output_pdf_path = os.path.join(folder_path, pdf_filename) - image_list[0].save( - output_pdf_path, - "PDF", - resolution=100.0, # High resolution - subsampling=0, - save_all=True, - append_images=image_list[1:] - ) - - print(f"Converted images in {subfolder} to PDF: {output_pdf_path}") - else: - print(f"No valid images found in folder: {subfolder_path}") - -# Set the folder path -folder_path = r"C:\Users\YLW-LAPTOP\Downloads\2021秋-写作与沟通-103-王沛楠" # Replace with the path to your folder - -# Convert images in subfolders to PDFs -convert_images_to_pdf(folder_path) diff --git a/vsd.exe b/vsd.exe deleted file mode 100644 index 17eb7d6..0000000 --- a/vsd.exe +++ /dev/null Binary files differ