Skip to content

Commit

Permalink
Add ffmpeg progress
Browse files Browse the repository at this point in the history
- Get progress info from 7z stdout for extarct and zip
- Change ffmpeg_cmds input. Check readme!
- Add all audios to media while convert

-- ToDo -- (Next Commit)
- Change how user add yt-dlp options and make it dict
- Refactor usettings, user can add part option instead of edit the whole option like extension filter or ffmpegcmds or yt-dlp options
- Add auto sessions restart interval
- Add upload paths in config.py also as dict
- Add merge video/audio/subtitles

Signed-off-by: anasty17 <[email protected]>
  • Loading branch information
anasty17 committed Jan 1, 2025
1 parent 0828296 commit 4749790
Show file tree
Hide file tree
Showing 21 changed files with 370 additions and 162 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ programming in Python.
- Ability to save upload paths
- Name Substitution to rename the files before upload
- User can select whether he want to use his rclone.conf/token.pickle without adding mpt: or mrcc: before path/gd-id
- FFmpeg commands to execute it after download (task option)
- Supported Direct links Generators:

> mediafire (file/folders), hxfile.co (need cookies txt with name) [hxfile.txt], streamtape.com, streamsb.net, streamhub.ink,
Expand Down Expand Up @@ -304,10 +305,12 @@ Fill up rest of the fields. Meaning of each field is discussed below.
- `USE_SERVICE_ACCOUNTS`: Whether to use Service Accounts or not, with google-api-python-client. For this to work
see [Using Service Accounts](https://github.com/anasty17/mirror-leech-telegram-bot#generate-service-accounts-what-is-service-account)
section below. Default is `False`. `Bool`
- `FFMPEG_CMDS`: list of ffmpeg commands. You can set multiple ffmpeg commands for all files before upload. Don't write ffmpeg at beginning, start directly with the arguments. `List`
- Examples: ["-i mltb.mkv -c copy -c:s srt mltb.mkv", "-i mltb.video -c copy -c:s srt mltb", "-i mltb.m4a -c:a libmp3lame -q:a 2 mltb.mp3", "-i mltb.audio -c:a libmp3lame -q:a 2 mltb.mp3"]
- `FFMPEG_CMDS`: Dict of list values of ffmpeg commands. You can set multiple ffmpeg commands for all files before upload. Don't write ffmpeg at beginning, start directly with the arguments. `Dict`
- Examples: {"subtitle": ["-i mltb.mkv -c copy -c:s srt mltb.mkv", "-i mltb.video -c copy -c:s srt mltb"], "convert": ["-i mltb.m4a -c:a libmp3lame -q:a 2 mltb.mp3", "-i mltb.audio -c:a libmp3lame -q:a 2 mltb.mp3"]}
**Notes**:
- Don't add ffmpeg at the beginning!
- Add `-del` to the list which you want from the bot to delete the original files after command run complete!
- To execute one of those lists in bot for example, you must use -ff subtitle (list key) or -ff convert (list key)
- Seed will get disbaled while using this option
**Example**:
- Here I will explain how to use mltb.* which is reference to files you want to work on.
Expand Down Expand Up @@ -470,7 +473,7 @@ sudo docker build . -t mltb
- Run the image:

```
sudo docker run -p 80:80 -p 8080:8080 mltb
sudo docker run -p 80:80 -p 8080:8080 -p 8070:8070 -p 8090:8090 mltb
```

- To stop the running image:
Expand Down Expand Up @@ -532,6 +535,8 @@ sudo docker compose logs --follow

------

</details>

**IMPORTANT NOTES**:

1. Set `BASE_URL_PORT` and `RCLONE_SERVE_PORT` variables to any port you want to use. Default is `80` and `8080`
Expand All @@ -542,7 +547,6 @@ sudo docker compose logs --follow

------

</details>
</details>
</details>

Expand Down
1 change: 0 additions & 1 deletion bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
nzb_listener_lock = Lock()
jd_lock = Lock()
cpu_eater_lock = Lock()
subprocess_lock = Lock()
same_directory_lock = Lock()
extension_filter = ["aria2", "!qB"]
drives_names = []
Expand Down
2 changes: 1 addition & 1 deletion bot/core/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Config:
DOWNLOAD_DIR = "/usr/src/app/downloads/"
EQUAL_SPLITS = False
EXTENSION_FILTER = ""
FFMPEG_CMDS = []
FFMPEG_CMDS = {}
FILELION_API = ""
GDRIVE_ID = ""
INCOMPLETE_TASK_NOTIFIER = False
Expand Down
Loading

0 comments on commit 4749790

Please sign in to comment.