From 47f1d1311fb1a62a6efbf3d85482bd6e1d92171f Mon Sep 17 00:00:00 2001 From: david Date: Tue, 13 Jan 2026 10:26:20 -0500 Subject: [PATCH 1/2] sync --- DownloaderWebApp/start.sh | 17 +++++++++++++++++ DownloaderWebApp/stop.sh | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 DownloaderWebApp/start.sh create mode 100755 DownloaderWebApp/stop.sh diff --git a/DownloaderWebApp/start.sh b/DownloaderWebApp/start.sh new file mode 100755 index 0000000..b965ac7 --- /dev/null +++ b/DownloaderWebApp/start.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Navigate to the script's directory +cd "$(dirname "$0")" + +# Check for virtual environment and activate if found +if [ -d "venv" ]; then + source venv/bin/activate +elif [ -d ".venv" ]; then + source .venv/bin/activate +fi + +echo "Starting DownloaderWebApp..." +python3 main.py & +PID=$! +echo $PID > app.pid +echo "Application started with PID: $PID" diff --git a/DownloaderWebApp/stop.sh b/DownloaderWebApp/stop.sh new file mode 100755 index 0000000..84ef1b0 --- /dev/null +++ b/DownloaderWebApp/stop.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Navigate to the script's directory +cd "$(dirname "$0")" + +if [ -f "app.pid" ]; then + PID=$(cat app.pid) + if ps -p $PID > /dev/null; then + echo "Stopping app (PID $PID)..." + kill $PID + rm app.pid + echo "Stopped." + else + echo "PID file found ($PID) but process is not running. Removing stale PID file." + rm app.pid + fi +else + echo "No PID file found. Trying to find process by name..." + pkill -f "python3 main.py" + if [ $? -eq 0 ]; then + echo "Stopped via process name." + else + echo "No running process found." + fi +fi From c0c6cdd15647f35b65386cd0f6ef74294aec3eda Mon Sep 17 00:00:00 2001 From: david Date: Wed, 14 Jan 2026 10:47:16 -0500 Subject: [PATCH 2/2] syncng --- .../__pycache__/merge_videos.cpython-313.pyc | Bin 0 -> 4158 bytes video_merge/context/README.md | 28 +++++ video_merge/context/merge_videos.py | 96 ++++++++++++++++++ video_merge/context/requirements.txt | 1 + video_merge/merge_videos.py | 96 ++++++++++++++++++ video_merge/requirements.txt | 1 + 6 files changed, 222 insertions(+) create mode 100644 video_merge/__pycache__/merge_videos.cpython-313.pyc create mode 100644 video_merge/context/README.md create mode 100644 video_merge/context/merge_videos.py create mode 100644 video_merge/context/requirements.txt create mode 100644 video_merge/merge_videos.py create mode 100644 video_merge/requirements.txt diff --git a/video_merge/__pycache__/merge_videos.cpython-313.pyc b/video_merge/__pycache__/merge_videos.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..686161553a839b4a9b651425669e9935d54651b4 GIT binary patch literal 4158 zcma(TTWs6b^-?5dJ*bCeONr#ywQF0JQqxZJLOkc;JeH<<~e@dZZmJm`bF&e(~ z2TY6^dlw>%(JAo!;v53ZZg$1&=I&jo4wEWTv&I<` zq0?}NuRhbBS20ARx!bfwI0KfyUQX+el7m4ynr?d??~XHd#wj;C&~&nwJxvkh2sP$v zoFGKczGB7$%!t=cMY( zPfk5=8N)h5_Iyv0C%^wnMif*~tjI(i7Box{pl4BTG8KF<_3BigPKEO=6RDJ#8pHX} zSw)eRF>Gj(WDT6mNhu;IoNo{FxUN7`mas4{q$NJ$(Alh#mNcDBOWB;J(-~3HSyfZg zS)I+ui=v`iWL0NKFm$VUE3Im(ZcVEsX1Z0#W<@C#vFHx6P8bo>9VEO7L!3(d!dUkh zVM-W5RQc?Z?w%L5L}QN<06qp@_22NhgC4iG-I>~C>;=a}nK@+ue3=<}>~L@TL#wl& zwcUIFk3A3f7bD|^p<@rH3mqp*{)vkJT+x577AQHxn;zfF z*l%yIwU#`6n_hn*aK7xFdgR@^!L?R95f>;h{{IA#H}r^WuUb(6SNsD-|G-+Zqs6SJDhyj!Yo z@1Wzfnd~VqLa`Q!Zb~#;oZgv+ae8`}gg2$_mf($owXFxrK%9=*hr!kz+8nQHYqG>? zdV@(*V4!GP+R)qkKmyyu#l_iI3qu_Bp*U;qmaK7R+Hc0F@sDpu3rY!e2q)T6j@;&c z3`G*;G3HuoY0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mV?d00001 diff --git a/video_merge/context/README.md b/video_merge/context/README.md new file mode 100644 index 0000000..9b32600 --- /dev/null +++ b/video_merge/context/README.md @@ -0,0 +1,28 @@ +# Video Merge Project Context + +This folder contains the necessary files to resume the Video Merge session. + +## Contents + +- `merge_videos.py`: The main Python script to merge video files. +- `requirements.txt`: List of Python dependencies. + +## Setup Instructions + +1. **Prerequisites**: Ensure Python 3 is installed on the new machine. +2. **Install Dependencies**: + Open a terminal in this folder and run: + ```bash + pip install -r requirements.txt + ``` + *Note: The script uses `moviepy`. If you encounter issues with ffmpeg, ensure it is installed on your system or that the `imageio-ffmpeg` package was installed successfully with moviepy.* + +## Running the Script + +To start the video merger tool: + +```bash +python3 merge_videos.py +``` + +Follow the on-screen prompts to input video file paths and the desired output filename. diff --git a/video_merge/context/merge_videos.py b/video_merge/context/merge_videos.py new file mode 100644 index 0000000..97e47b0 --- /dev/null +++ b/video_merge/context/merge_videos.py @@ -0,0 +1,96 @@ +import os +import sys + +def get_file_paths(): + """Prompts the user for video file paths.""" + file_paths = [] + print("Enter the paths to the video files you want to merge.") + print("Type 'done' when you are finished.") + + while True: + user_input = input(f"File path #{len(file_paths) + 1}: ").strip() + + if user_input.lower() == 'done': + if len(file_paths) < 2: + print("Please provide at least two video files to merge.") + continue + break + + if not user_input: + continue + + # Remove quotes if the user pasted a path with quotes + user_input = user_input.strip('"').strip("'") + + if os.path.exists(user_input) and os.path.isfile(user_input): + file_paths.append(user_input) + print(f"Added: {user_input}") + else: + print(f"Error: File not found at '{user_input}'. Please try again.") + + return file_paths + +def main(): + print("--- Video Merger Tool ---") + + try: + # Check if moviepy is installed + try: + from moviepy.editor import VideoFileClip, concatenate_videoclips + except ImportError: + print("Error: 'moviepy' library is not installed.") + print("Please run: pip install -r requirements.txt") + return + + video_files = get_file_paths() + + output_filename = input("Enter the output file name (e.g., merged_video.mp4): ").strip() + if not output_filename: + output_filename = "merged_output.mp4" + print(f"No name provided. Using default: {output_filename}") + + if not output_filename.lower().endswith(".mp4"): + output_filename += ".mp4" + print(f"Added extension. Output will be: {output_filename}") + + print("\nProcessing videos... This may take a while depending on file size.") + + clips = [] + try: + for path in video_files: + print(f"Loading {path}...") + clip = VideoFileClip(path) + clips.append(clip) + + print("Concatenating clips...") + final_clip = concatenate_videoclips(clips) + + print(f"Writing to {output_filename} (H.264 / AAC)...") + final_clip.write_videofile( + output_filename, + codec='libx264', + audio_codec='aac', + temp_audiofile='temp-audio.m4a', + remove_temp=True, + logger='bar' + ) + + print(f"\nSuccess! Merged video saved to: {os.path.abspath(output_filename)}") + + except Exception as e: + print(f"\nAn error occurred during processing: {e}") + finally: + # Clean up resources + for clip in clips: + try: + clip.close() + except: + pass + + except KeyboardInterrupt: + print("\nOperation cancelled by user.") + except Exception as e: + print(f"\nUnexpected error: {e}") + +if __name__ == "__main__": + main() diff --git a/video_merge/context/requirements.txt b/video_merge/context/requirements.txt new file mode 100644 index 0000000..a384113 --- /dev/null +++ b/video_merge/context/requirements.txt @@ -0,0 +1 @@ +moviepy diff --git a/video_merge/merge_videos.py b/video_merge/merge_videos.py new file mode 100644 index 0000000..97e47b0 --- /dev/null +++ b/video_merge/merge_videos.py @@ -0,0 +1,96 @@ +import os +import sys + +def get_file_paths(): + """Prompts the user for video file paths.""" + file_paths = [] + print("Enter the paths to the video files you want to merge.") + print("Type 'done' when you are finished.") + + while True: + user_input = input(f"File path #{len(file_paths) + 1}: ").strip() + + if user_input.lower() == 'done': + if len(file_paths) < 2: + print("Please provide at least two video files to merge.") + continue + break + + if not user_input: + continue + + # Remove quotes if the user pasted a path with quotes + user_input = user_input.strip('"').strip("'") + + if os.path.exists(user_input) and os.path.isfile(user_input): + file_paths.append(user_input) + print(f"Added: {user_input}") + else: + print(f"Error: File not found at '{user_input}'. Please try again.") + + return file_paths + +def main(): + print("--- Video Merger Tool ---") + + try: + # Check if moviepy is installed + try: + from moviepy.editor import VideoFileClip, concatenate_videoclips + except ImportError: + print("Error: 'moviepy' library is not installed.") + print("Please run: pip install -r requirements.txt") + return + + video_files = get_file_paths() + + output_filename = input("Enter the output file name (e.g., merged_video.mp4): ").strip() + if not output_filename: + output_filename = "merged_output.mp4" + print(f"No name provided. Using default: {output_filename}") + + if not output_filename.lower().endswith(".mp4"): + output_filename += ".mp4" + print(f"Added extension. Output will be: {output_filename}") + + print("\nProcessing videos... This may take a while depending on file size.") + + clips = [] + try: + for path in video_files: + print(f"Loading {path}...") + clip = VideoFileClip(path) + clips.append(clip) + + print("Concatenating clips...") + final_clip = concatenate_videoclips(clips) + + print(f"Writing to {output_filename} (H.264 / AAC)...") + final_clip.write_videofile( + output_filename, + codec='libx264', + audio_codec='aac', + temp_audiofile='temp-audio.m4a', + remove_temp=True, + logger='bar' + ) + + print(f"\nSuccess! Merged video saved to: {os.path.abspath(output_filename)}") + + except Exception as e: + print(f"\nAn error occurred during processing: {e}") + finally: + # Clean up resources + for clip in clips: + try: + clip.close() + except: + pass + + except KeyboardInterrupt: + print("\nOperation cancelled by user.") + except Exception as e: + print(f"\nUnexpected error: {e}") + +if __name__ == "__main__": + main() diff --git a/video_merge/requirements.txt b/video_merge/requirements.txt new file mode 100644 index 0000000..a384113 --- /dev/null +++ b/video_merge/requirements.txt @@ -0,0 +1 @@ +moviepy