StreamingCommunity


NameStreamingCommunity JSON
Version 2.9.1 PyPI version JSON
download
home_pagehttps://github.com/Lovi-0/StreamingCommunity
SummaryNone
upload_time2025-03-02 13:39:57
maintainerNone
docs_urlNone
authorLovi-0
requires_python>=3.8
licenseNone
keywords streaming community
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://i.ibb.co/v6RnT0wY/s2.jpg" alt="Project Logo" width="700"/>
</p>

<p align="center">
  <a href="https://pypi.org/project/streamingcommunity">
    <img src="https://img.shields.io/pypi/v/streamingcommunity?logo=pypi&labelColor=555555&style=for-the-badge" alt="PyPI"/>
  </a>
  <a href="https://www.paypal.com/donate/?hosted_button_id=UXTWMT8P6HE2C">
    <img src="https://img.shields.io/badge/_-Donate-red.svg?logo=githubsponsors&labelColor=555555&style=for-the-badge" alt="Donate"/>
  </a>
  <a href="https://github.com/Arrowar/StreamingCommunity/commits">
    <img src="https://img.shields.io/github/commit-activity/m/Arrowar/StreamingCommunity?label=commits&style=for-the-badge" alt="Commits"/>
  </a>
  <a href="https://github.com/Arrowar/StreamingCommunity/commits">
    <img src="https://img.shields.io/github/last-commit/Arrowar/StreamingCommunity/main?label=&style=for-the-badge&display_timestamp=committer" alt="Last Commit"/>
  </a>
</p>

<p align="center">
  <a href="https://github.com/Arrowar/StreamingCommunity/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/License-GPL_3.0-blue.svg?style=for-the-badge" alt="License"/>
  </a>
  <a href="https://pypi.org/project/streamingcommunity">
    <img src="https://img.shields.io/pypi/dm/streamingcommunity?style=for-the-badge" alt="PyPI Downloads"/>
  </a>
  <a href="https://github.com/Arrowar/StreamingCommunity">
    <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Arrowar/StreamingCommunity/main/.github/media/loc-badge.json&style=for-the-badge" alt="Lines of Code"/>
  </a>
</p>

# 📋 Table of Contents

- 🔄 [Update Domains](#update-domains)
- 🛠️ [Installation](#installation)
    - 📦 [PyPI Installation](#1-pypi-installation)
    - 🔄 [Automatic Installation](#2-automatic-installation)
    - 🔧 [Binary Location](#binary-location)
    - 📝 [Manual Installation](#3-manual-installation)
        - 💻 [Win 7](https://github.com/Ghost6446/StreamingCommunity_api/wiki/Installation#win-7)
        - 📱 [Termux](https://github.com/Ghost6446/StreamingCommunity_api/wiki/Termux)
- ⚙️ [Configuration](#configuration)
    - 🔧 [Default](#default-settings)
    - 📩 [Request](#requests-settings)
    - 📥 [Download](#m3u8_download-settings)
    - 🔍 [Parser](#m3u8_parser-settings)
- 📝 [Command](#command)
- 💻 [Examples of terminal](#examples-of-terminal-usage)
- 🐳 [Docker](#docker)
- 📝 [Telegram Usage](#telegram-usage)
- 🎓 [Tutorial](#tutorials)
- 📝 [To do](#to-do)
- 💬 [Support](#support)
- 🤝 [Contribute](#contributing)
- ⚠️ [Disclaimer](#disclaimer)
- ⚡ [Contributors](#contributors)

# Installation

<p align="center">
  <a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_win.exe" style="margin: 0 20px;">
    <img src="https://img.shields.io/badge/-Windows-blue.svg?style=for-the-badge&logo=windows" alt="Windows">
  </a>
  <a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_mac" style="margin: 0 20px;">
    <img src="https://img.shields.io/badge/-macOS-black.svg?style=for-the-badge&logo=apple" alt="macOS">
  </a>
  <a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_linux" style="margin: 0 20px;">
    <img src="https://img.shields.io/badge/-Linux-orange.svg?style=for-the-badge&logo=linux" alt="Linux">
  </a>
</p>


## 1. PyPI Installation

Install directly from PyPI:

```bash
pip install StreamingCommunity
```

### Creating a Run Script

Create `run_streaming.py`:

```python
from StreamingCommunity.run import main

if __name__ == "__main__":
    main()
```

Run the script:
```bash
python run_streaming.py
```

### Updating via PyPI

```bash
pip install --upgrade StreamingCommunity
```

## 2. Automatic Installation

### Supported Operating Systems 💿

| OS              | Automatic Installation Support |
|:----------------|:------------------------------:|
| Windows 10/11   |              ✔️              |
| Windows 7       |              ❌              |
| Debian Linux    |              ✔️              |
| Arch Linux      |              ✔️              |
| CentOS Stream 9 |              ✔️              |
| FreeBSD         |              ⏳              |
| MacOS           |              ✔️              |
| Termux          |              ❌              |

### Installation Steps

#### On Windows:

```powershell
.\Installer\win_install.bat
```

#### On Linux/MacOS/BSD:

```bash
sudo chmod +x Installer/unix_install.sh && ./Installer/unix_install.sh
```

### Usage

#### On Windows:

```powershell
python .\test_run.py
```

or

```powershell
source .venv/bin/activate && python test_run.py && deactivate
```

#### On Linux/MacOS/BSD:

```bash
./test_run.py
```

## Binary Location

### Default Locations
- **Windows**: `C:\binary`
- **MacOS**: `~/Applications/binary`
- **Linux**: `~/.local/bin/binary`

You can customize these locations by following these steps for your operating system:

#### Windows
1. Move the binary folder from `C:\binary` to your desired location
2. Add the new path to Windows environment variables:
   - Open Start menu and search for "Environment Variables"
   - Click "Edit the system environment variables"
   - Click "Environment Variables" button
   - Under "System Variables", find and select "Path"
   - Click "Edit"
   - Add the new binary folder path
   - Click "OK" to save changes

For detailed Windows PATH instructions, see the [Windows PATH guide](https://www.eukhost.com/kb/how-to-add-to-the-path-on-windows-10-and-windows-11/).

#### MacOS
1. Move the binary folder from `~/Applications/binary` to your desired location
2. Add the new path to your shell's configuration file:
   ```bash
   # For bash (edit ~/.bash_profile)
   export PATH="/your/custom/path:$PATH"

   # For zsh (edit ~/.zshrc)
   export PATH="/your/custom/path:$PATH"
   ```
3. Reload your shell configuration:
   ```bash
   # For bash
   source ~/.bash_profile

   # For zsh
   source ~/.zshrc
   ```

#### Linux
1. Move the binary folder from `~/.local/bin/binary` to your desired location
2. Add the new path to your shell's configuration file:
   ```bash
   # For bash (edit ~/.bashrc)
   export PATH="/your/custom/path:$PATH"

   # For zsh (edit ~/.zshrc)
   export PATH="/your/custom/path:$PATH"
   ```
3. Apply the changes:
   ```bash
   source ~/.bashrc   # for bash
   # or
   source ~/.zshrc    # for zsh
   ```

> [!IMPORTANT]
> After moving the binary folder, ensure that all executables (ffmpeg, ffprobe, ffplay) are present in the new location and have the correct permissions:
> - Windows: `.exe` extensions required
> - MacOS/Linux: Ensure files have execute permissions (`chmod +x filename`)

## 3. Manual Installation

### Requirements 📋

Prerequisites:
* [Python](https://www.python.org/downloads/) > 3.8
* [FFmpeg](https://www.gyan.dev/ffmpeg/builds/)

### Install Python Dependencies

```bash
pip install -r requirements.txt
```

### Usage

#### On Windows:

```powershell
python test_run.py
```

#### On Linux/MacOS:

```bash
python3 test_run.py
```

## Update

Keep your script up to date with the latest features by running:

### On Windows:

```powershell
python update.py
```

### On Linux/MacOS:

```bash
python3 update.py
```

<br>

# Configuration

You can change some behaviors by tweaking the configuration file.

The configuration file is divided into several main sections:

## DEFAULT Settings

```json
{
    "DEFAULT": {
        "debug": false,
        "show_message": true,
        "clean_console": true,
        "show_trending": true,
        "use_api": true,
        "not_close": false,
        "telegram_bot": false
    }
}
```

- `debug`: Enables debug logging
- `show_message`: Displays informational messages
- `clean_console`: Clears the console between operations
- `show_trending`: Shows trending content
- `use_api`: Uses API for domain updates instead of local configuration
- `not_close`: If set to true, keeps the program running after download is complete
  * Can be changed from terminal with `--not_close true/false`
- `telegram_bot`: Enables Telegram bot integration

## OUT_FOLDER Settings

```json
{
    "OUT_FOLDER": {
        "root_path": "Video",
        "movie_folder_name": "Movie",
        "serie_folder_name": "Serie",
        "anime_folder_name": "Anime",
        "map_episode_name": "E%(episode)_%(episode_name)",
        "add_siteName": false
    }
}
```

- `root_path`: Directory where all videos will be saved

  ### Path examples:
  * Windows: `C:\\MyLibrary\\Folder` or `\\\\MyServer\\MyLibrary` (if you want to use a network folder)
  * Linux/MacOS: `Desktop/MyLibrary/Folder`
    <br/><br/>

- `movie_folder_name`: The name of the subdirectory where movies will be stored
  * Can be changed from terminal with `--movie_folder_name`
    <br/><br/>

- `serie_folder_name`: The name of the subdirectory where TV series will be stored
  * Can be changed from terminal with `--serie_folder_name`
    <br/><br/>

- `anime_folder_name`: The name of the subdirectory where anime will be stored
  * Can be changed from terminal with `--anime_folder_name`
    <br/><br/>

- `map_episode_name`: Template for episode filenames

  ### Episode name usage:

  You can choose different vars:
  * `%(tv_name)` : Is the name of TV Show
  * `%(season)` : Is the number of the season
  * `%(episode)` : Is the number of the episode
  * `%(episode_name)` : Is the name of the episode
  * Can be changed from terminal with `--map_episode_name`
    <br><br>

- `add_siteName`: If set to true, appends the site_name to the root path before the movie and serie folders
  * Can be changed from terminal with `--add_siteName true/false`
    <br/><br/>

## QBIT_CONFIG Settings

```json
{
    "QBIT_CONFIG": {
        "host": "192.168.1.51",
        "port": "6666",
        "user": "admin",
        "pass": "adminadmin"
    }
}
```

To enable qBittorrent integration, follow the setup guide [here](https://github.com/lgallard/qBittorrent-Controller/wiki/How-to-enable-the-qBittorrent-Web-UI).

## REQUESTS Settings

```json
{
    "REQUESTS": {
        "verify": false,
        "timeout": 20,
        "max_retry": 8
    }
}
```

- `verify`: Verifies SSL certificates
- `timeout`: Maximum timeout (in seconds) for each request
- `max_retry`: Number of retry attempts per segment during M3U8 index download

## M3U8_DOWNLOAD Settings

```json
{
    "M3U8_DOWNLOAD": {
        "tqdm_delay": 0.01,
        "default_video_workser": 12,
        "default_audio_workser": 12,
        "segment_timeout": 8,
        "download_audio": true,
        "merge_audio": true,
        "specific_list_audio": [
            "ita"
        ],
        "download_subtitle": true,
        "merge_subs": true,
        "specific_list_subtitles": [
            "ita",
            "eng"
        ],
        "cleanup_tmp_folder": true
    }
}
```

- `tqdm_delay`: Delay between progress bar updates
- `default_video_workser`: Number of threads for video download
  * Can be changed from terminal with `--default_video_worker <number>`
    <br/><br/>

- `default_audio_workser`: Number of threads for audio download
  * Can be changed from terminal with `--default_audio_worker <number>`
    <br/><br/>

- `segment_timeout`: Timeout for downloading individual segments
- `download_audio`: Whether to download audio tracks
- `merge_audio`: Whether to merge audio with video
- `specific_list_audio`: List of audio languages to download
  * Can be changed from terminal with `--specific_list_audio ita,eng`
    <br/><br/>

- `download_subtitle`: Whether to download subtitles
- `merge_subs`: Whether to merge subtitles with video
- `specific_list_subtitles`: List of subtitle languages to download
  * Can be changed from terminal with `--specific_list_subtitles ita,eng`
    <br/><br/>

- `cleanup_tmp_folder`: Remove temporary .ts files after download

## Available Language Codes

| European        | Asian           | Middle Eastern  | Others          |
|-----------------|-----------------|-----------------|-----------------|
| ita - Italian   | chi - Chinese   | ara - Arabic    | eng - English   |
| spa - Spanish   | jpn - Japanese  | heb - Hebrew    | por - Portuguese|
| fre - French    | kor - Korean    | tur - Turkish   | fil - Filipino  |
| ger - German    | hin - Hindi     |                 | ind - Indonesian|
| rus - Russian   | mal - Malayalam |                 | may - Malay     |
| swe - Swedish   | tam - Tamil     |                 | vie - Vietnamese|
| pol - Polish    | tel - Telugu    |                 |                 |
| ukr - Ukrainian | tha - Thai      |                 |                 |

## M3U8_CONVERSION Settings

```json
{
    "M3U8_CONVERSION": {
        "use_codec": false,
        "use_vcodec": true,
        "use_acodec": true,
        "use_bitrate": true,
        "use_gpu": false,
        "default_preset": "ultrafast"
    }
}
```

- `use_codec`: Use specific codec settings
- `use_vcodec`: Use specific video codec
- `use_acodec`: Use specific audio codec
- `use_bitrate`: Apply bitrate settings
- `use_gpu`: Enable GPU acceleration (if available)
- `default_preset`: FFmpeg encoding preset (ultrafast, fast, medium, slow, etc.)

### Advanced M3U8 Conversion Options

The software supports various advanced encoding options via FFmpeg:

#### Encoding Presets
The `default_preset` configuration can be set to one of the following values:
- `ultrafast`: Extremely fast conversion but larger file size
- `superfast`: Very fast with good quality/size ratio
- `veryfast`: Fast with good compression
- `faster`: Optimal balance for most users
- `fast`: Good compression, moderate time
- `medium`: FFmpeg default setting
- `slow`: High quality, slower process
- `slower`: Very high quality, slow process
- `veryslow`: Maximum quality, very slow process

#### GPU Acceleration
When `use_gpu` is enabled, the system will use available hardware acceleration:
- NVIDIA: NVENC 
- AMD: AMF
- Intel: QSV

You need to have updated drivers and FFmpeg compiled with hardware acceleration support.

## M3U8_PARSER Settings

```json
{
    "M3U8_PARSER": {
        "force_resolution": "Best",
        "get_only_link": false
    }
}
```

- `force_resolution`: Choose the video resolution for downloading:
    * `"Best"`: Highest available resolution
    * `"Worst"`: Lowest available resolution
    * `"720p"`: Force 720p resolution
    * Or specify one of these resolutions:
        - 1080p (1920x1080)
        - 720p (1280x720)
        - 480p (640x480)
        - 360p (640x360)
        - 320p (480x320)
        - 240p (426x240)
        - 240p (320x240)
        - 144p (256x144)

- `get_only_link`: Return M3U8 playlist/index URL instead of downloading

## SITE_EXTRA Settings

```json
{
    "SITE_EXTRA": {
        "ddlstreamitaly": {
            "ips4_device_key": "",
            "ips4_member_id": "",
            "ips4_login_key": ""
        }
    }
}
```

- Site-specific configuration for `ddlstreamitaly`:
  - `ips4_device_key`: Device key for authentication
  - `ips4_member_id`: Member ID for authentication
  - `ips4_login_key`: Login key for authentication
  
## Update Domains

There are two ways to update the domains for the supported websites:

### 1. Using Local Configuration

1. Create a `domains.json` file in the root directory of the project

2. Add your domain configuration in the following format:
   ```json
   {
      "altadefinizione": {
          "domain": "si",
          "full_url": "https://altadefinizione.si/"
      },
      ...
   }
   ```
   
3. Set `use_api` to `false` in the `DEFAULT` section of your `config.json`:
   ```json
   {
      "DEFAULT": {
         "use_api": false
      }
   }
   ```

### 2. Using API (Legacy)

The API-based domain updates are currently deprecated. To use it anyway, set `use_api` to `true` in your `config.json` file.

Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.

# COMMAND

- Download a specific season by entering its number.
  *  **Example:** `1` will download *Season 1* only.

-  Use the wildcard `*` to download every available season.
   * **Example:** `*` will download all seasons in the series.

- Specify a range of seasons using a hyphen `-`.
   * **Example:** `1-2` will download *Seasons 1 and 2*.

- Enter a season number followed by `-*` to download from that season to the end.
  * **Example:** `3-*` will download from *Season 3* to the final season.

# Examples of terminal usage

```bash
# Change video and audio workers
python test_run.py --default_video_worker 8 --default_audio_worker 8

# Set specific languages
python test_run.py --specific_list_audio ita,eng --specific_list_subtitles eng,spa

# Keep console open after download
python test_run.py --not_close true
```

# Docker

You can run the script in a docker container, to build the image just run

```
docker build -t streaming-community-api .
```

and to run it use

```
docker run -it -p 8000:8000 streaming-community-api
```

By default the videos will be saved in `/app/Video` inside the container, if you want to to save them in your machine instead of the container just run

```
docker run -it -p 8000:8000 -v /path/to/download:/app/Video streaming-community-api
```

### Docker quick setup with Make

Inside the Makefile (install `make`) are already configured two commands to build and run the container:

```
make build-container

# set your download directory as ENV variable
make LOCAL_DIR=/path/to/download run-container
```

The `run-container` command mounts also the `config.json` file, so any change to the configuration file is reflected immediately without having to rebuild the image.

# Telegram Usage

## Configuration

The bot was created to replace terminal commands and allow interaction via Telegram. Each download runs within a screen session, enabling multiple downloads to run simultaneously.

To run the bot in the background, simply start it inside a screen session and then press Ctrl + A, followed by D, to detach from the session without stopping the bot.

Command Functions:

🔹 /start – Starts a new search for a download. This command performs the same operations as manually running the script in the terminal with test_run.py.

🔹 /list – Displays the status of active downloads, with options to:

Stop an incorrect download using /stop <ID>.

View the real-time output of a download using /screen <ID>.

⚠ Warning: If a download is interrupted, incomplete files may remain in the folder specified in config.json. These files must be deleted manually to avoid storage or management issues.

🛠 Configuration: Currently, the bot's settings are stored in the config.json file, which is located in the same directory as the telegram_bot.py script.

## .env Example:

You need to create an .env file and enter your Telegram token and user ID to authorize only one user to use it

```
TOKEN_TELEGRAM=IlTuo2131TOKEN$12D3Telegram
AUTHORIZED_USER_ID=12345678
DEBUG=False
```

## Install Python Dependencies

```bash
pip install -r requirements.txt
```

## On Linux/MacOS:

Start the bot from the folder /StreamingCommunity/TelegramHelp

```bash
python3 telegram_bot.py
```

# Tutorials

- [Windows Tutorial](https://www.youtube.com/watch?v=mZGqK4wdN-k)
- [Linux Tutorial](https://www.youtube.com/watch?v=0qUNXPE_mTg)
- [Pypy Tutorial](https://www.youtube.com/watch?v=C6m9ZKOK0p4)
- [Compiled .exe Tutorial](https://www.youtube.com/watch?v=pm4lqsxkTVo)

# To Do

- To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)
- To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)

# Contributing

Contributions are welcome! Steps:
1. Fork the repository
2. Create feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to branch (`git push origin feature/AmazingFeature`)
5. Open Pull Request


# Disclaimer

This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

## Contributors

<a href="https://github.com/Arrowar/StreamingCommunity/graphs/contributors" alt="View Contributors">
  <img src="https://contrib.rocks/image?repo=Arrowar/StreamingCommunity&max=1000&columns=10" alt="Contributors" />
</a>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Lovi-0/StreamingCommunity",
    "name": "StreamingCommunity",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "streaming community",
    "author": "Lovi-0",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/0c/8b/7966d65e004f9995b3ec6aeef108f6af3bc579829979d0a8a4132b25795e/StreamingCommunity-2.9.1.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"https://i.ibb.co/v6RnT0wY/s2.jpg\" alt=\"Project Logo\" width=\"700\"/>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/streamingcommunity\">\n    <img src=\"https://img.shields.io/pypi/v/streamingcommunity?logo=pypi&labelColor=555555&style=for-the-badge\" alt=\"PyPI\"/>\n  </a>\n  <a href=\"https://www.paypal.com/donate/?hosted_button_id=UXTWMT8P6HE2C\">\n    <img src=\"https://img.shields.io/badge/_-Donate-red.svg?logo=githubsponsors&labelColor=555555&style=for-the-badge\" alt=\"Donate\"/>\n  </a>\n  <a href=\"https://github.com/Arrowar/StreamingCommunity/commits\">\n    <img src=\"https://img.shields.io/github/commit-activity/m/Arrowar/StreamingCommunity?label=commits&style=for-the-badge\" alt=\"Commits\"/>\n  </a>\n  <a href=\"https://github.com/Arrowar/StreamingCommunity/commits\">\n    <img src=\"https://img.shields.io/github/last-commit/Arrowar/StreamingCommunity/main?label=&style=for-the-badge&display_timestamp=committer\" alt=\"Last Commit\"/>\n  </a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/Arrowar/StreamingCommunity/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/badge/License-GPL_3.0-blue.svg?style=for-the-badge\" alt=\"License\"/>\n  </a>\n  <a href=\"https://pypi.org/project/streamingcommunity\">\n    <img src=\"https://img.shields.io/pypi/dm/streamingcommunity?style=for-the-badge\" alt=\"PyPI Downloads\"/>\n  </a>\n  <a href=\"https://github.com/Arrowar/StreamingCommunity\">\n    <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Arrowar/StreamingCommunity/main/.github/media/loc-badge.json&style=for-the-badge\" alt=\"Lines of Code\"/>\n  </a>\n</p>\n\n# \ud83d\udccb Table of Contents\n\n- \ud83d\udd04 [Update Domains](#update-domains)\n- \ud83d\udee0\ufe0f [Installation](#installation)\n    - \ud83d\udce6 [PyPI Installation](#1-pypi-installation)\n    - \ud83d\udd04 [Automatic Installation](#2-automatic-installation)\n    - \ud83d\udd27 [Binary Location](#binary-location)\n    - \ud83d\udcdd [Manual Installation](#3-manual-installation)\n        - \ud83d\udcbb [Win 7](https://github.com/Ghost6446/StreamingCommunity_api/wiki/Installation#win-7)\n        - \ud83d\udcf1 [Termux](https://github.com/Ghost6446/StreamingCommunity_api/wiki/Termux)\n- \u2699\ufe0f [Configuration](#configuration)\n    - \ud83d\udd27 [Default](#default-settings)\n    - \ud83d\udce9 [Request](#requests-settings)\n    - \ud83d\udce5 [Download](#m3u8_download-settings)\n    - \ud83d\udd0d [Parser](#m3u8_parser-settings)\n- \ud83d\udcdd [Command](#command)\n- \ud83d\udcbb [Examples of terminal](#examples-of-terminal-usage)\n- \ud83d\udc33 [Docker](#docker)\n- \ud83d\udcdd [Telegram Usage](#telegram-usage)\n- \ud83c\udf93 [Tutorial](#tutorials)\n- \ud83d\udcdd [To do](#to-do)\n- \ud83d\udcac [Support](#support)\n- \ud83e\udd1d [Contribute](#contributing)\n- \u26a0\ufe0f [Disclaimer](#disclaimer)\n- \u26a1 [Contributors](#contributors)\n\n# Installation\n\n<p align=\"center\">\n  <a href=\"https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_win.exe\" style=\"margin: 0 20px;\">\n    <img src=\"https://img.shields.io/badge/-Windows-blue.svg?style=for-the-badge&logo=windows\" alt=\"Windows\">\n  </a>\n  <a href=\"https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_mac\" style=\"margin: 0 20px;\">\n    <img src=\"https://img.shields.io/badge/-macOS-black.svg?style=for-the-badge&logo=apple\" alt=\"macOS\">\n  </a>\n  <a href=\"https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_linux\" style=\"margin: 0 20px;\">\n    <img src=\"https://img.shields.io/badge/-Linux-orange.svg?style=for-the-badge&logo=linux\" alt=\"Linux\">\n  </a>\n</p>\n\n\n## 1. PyPI Installation\n\nInstall directly from PyPI:\n\n```bash\npip install StreamingCommunity\n```\n\n### Creating a Run Script\n\nCreate `run_streaming.py`:\n\n```python\nfrom StreamingCommunity.run import main\n\nif __name__ == \"__main__\":\n    main()\n```\n\nRun the script:\n```bash\npython run_streaming.py\n```\n\n### Updating via PyPI\n\n```bash\npip install --upgrade StreamingCommunity\n```\n\n## 2. Automatic Installation\n\n### Supported Operating Systems \ud83d\udcbf\n\n| OS              | Automatic Installation Support |\n|:----------------|:------------------------------:|\n| Windows 10/11   |              \u2714\ufe0f              |\n| Windows 7       |              \u274c              |\n| Debian Linux    |              \u2714\ufe0f              |\n| Arch Linux      |              \u2714\ufe0f              |\n| CentOS Stream 9 |              \u2714\ufe0f              |\n| FreeBSD         |              \u23f3              |\n| MacOS           |              \u2714\ufe0f              |\n| Termux          |              \u274c              |\n\n### Installation Steps\n\n#### On Windows:\n\n```powershell\n.\\Installer\\win_install.bat\n```\n\n#### On Linux/MacOS/BSD:\n\n```bash\nsudo chmod +x Installer/unix_install.sh && ./Installer/unix_install.sh\n```\n\n### Usage\n\n#### On Windows:\n\n```powershell\npython .\\test_run.py\n```\n\nor\n\n```powershell\nsource .venv/bin/activate && python test_run.py && deactivate\n```\n\n#### On Linux/MacOS/BSD:\n\n```bash\n./test_run.py\n```\n\n## Binary Location\n\n### Default Locations\n- **Windows**: `C:\\binary`\n- **MacOS**: `~/Applications/binary`\n- **Linux**: `~/.local/bin/binary`\n\nYou can customize these locations by following these steps for your operating system:\n\n#### Windows\n1. Move the binary folder from `C:\\binary` to your desired location\n2. Add the new path to Windows environment variables:\n   - Open Start menu and search for \"Environment Variables\"\n   - Click \"Edit the system environment variables\"\n   - Click \"Environment Variables\" button\n   - Under \"System Variables\", find and select \"Path\"\n   - Click \"Edit\"\n   - Add the new binary folder path\n   - Click \"OK\" to save changes\n\nFor detailed Windows PATH instructions, see the [Windows PATH guide](https://www.eukhost.com/kb/how-to-add-to-the-path-on-windows-10-and-windows-11/).\n\n#### MacOS\n1. Move the binary folder from `~/Applications/binary` to your desired location\n2. Add the new path to your shell's configuration file:\n   ```bash\n   # For bash (edit ~/.bash_profile)\n   export PATH=\"/your/custom/path:$PATH\"\n\n   # For zsh (edit ~/.zshrc)\n   export PATH=\"/your/custom/path:$PATH\"\n   ```\n3. Reload your shell configuration:\n   ```bash\n   # For bash\n   source ~/.bash_profile\n\n   # For zsh\n   source ~/.zshrc\n   ```\n\n#### Linux\n1. Move the binary folder from `~/.local/bin/binary` to your desired location\n2. Add the new path to your shell's configuration file:\n   ```bash\n   # For bash (edit ~/.bashrc)\n   export PATH=\"/your/custom/path:$PATH\"\n\n   # For zsh (edit ~/.zshrc)\n   export PATH=\"/your/custom/path:$PATH\"\n   ```\n3. Apply the changes:\n   ```bash\n   source ~/.bashrc   # for bash\n   # or\n   source ~/.zshrc    # for zsh\n   ```\n\n> [!IMPORTANT]\n> After moving the binary folder, ensure that all executables (ffmpeg, ffprobe, ffplay) are present in the new location and have the correct permissions:\n> - Windows: `.exe` extensions required\n> - MacOS/Linux: Ensure files have execute permissions (`chmod +x filename`)\n\n## 3. Manual Installation\n\n### Requirements \ud83d\udccb\n\nPrerequisites:\n* [Python](https://www.python.org/downloads/) > 3.8\n* [FFmpeg](https://www.gyan.dev/ffmpeg/builds/)\n\n### Install Python Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### Usage\n\n#### On Windows:\n\n```powershell\npython test_run.py\n```\n\n#### On Linux/MacOS:\n\n```bash\npython3 test_run.py\n```\n\n## Update\n\nKeep your script up to date with the latest features by running:\n\n### On Windows:\n\n```powershell\npython update.py\n```\n\n### On Linux/MacOS:\n\n```bash\npython3 update.py\n```\n\n<br>\n\n# Configuration\n\nYou can change some behaviors by tweaking the configuration file.\n\nThe configuration file is divided into several main sections:\n\n## DEFAULT Settings\n\n```json\n{\n    \"DEFAULT\": {\n        \"debug\": false,\n        \"show_message\": true,\n        \"clean_console\": true,\n        \"show_trending\": true,\n        \"use_api\": true,\n        \"not_close\": false,\n        \"telegram_bot\": false\n    }\n}\n```\n\n- `debug`: Enables debug logging\n- `show_message`: Displays informational messages\n- `clean_console`: Clears the console between operations\n- `show_trending`: Shows trending content\n- `use_api`: Uses API for domain updates instead of local configuration\n- `not_close`: If set to true, keeps the program running after download is complete\n  * Can be changed from terminal with `--not_close true/false`\n- `telegram_bot`: Enables Telegram bot integration\n\n## OUT_FOLDER Settings\n\n```json\n{\n    \"OUT_FOLDER\": {\n        \"root_path\": \"Video\",\n        \"movie_folder_name\": \"Movie\",\n        \"serie_folder_name\": \"Serie\",\n        \"anime_folder_name\": \"Anime\",\n        \"map_episode_name\": \"E%(episode)_%(episode_name)\",\n        \"add_siteName\": false\n    }\n}\n```\n\n- `root_path`: Directory where all videos will be saved\n\n  ### Path examples:\n  * Windows: `C:\\\\MyLibrary\\\\Folder` or `\\\\\\\\MyServer\\\\MyLibrary` (if you want to use a network folder)\n  * Linux/MacOS: `Desktop/MyLibrary/Folder`\n    <br/><br/>\n\n- `movie_folder_name`: The name of the subdirectory where movies will be stored\n  * Can be changed from terminal with `--movie_folder_name`\n    <br/><br/>\n\n- `serie_folder_name`: The name of the subdirectory where TV series will be stored\n  * Can be changed from terminal with `--serie_folder_name`\n    <br/><br/>\n\n- `anime_folder_name`: The name of the subdirectory where anime will be stored\n  * Can be changed from terminal with `--anime_folder_name`\n    <br/><br/>\n\n- `map_episode_name`: Template for episode filenames\n\n  ### Episode name usage:\n\n  You can choose different vars:\n  * `%(tv_name)` : Is the name of TV Show\n  * `%(season)` : Is the number of the season\n  * `%(episode)` : Is the number of the episode\n  * `%(episode_name)` : Is the name of the episode\n  * Can be changed from terminal with `--map_episode_name`\n    <br><br>\n\n- `add_siteName`: If set to true, appends the site_name to the root path before the movie and serie folders\n  * Can be changed from terminal with `--add_siteName true/false`\n    <br/><br/>\n\n## QBIT_CONFIG Settings\n\n```json\n{\n    \"QBIT_CONFIG\": {\n        \"host\": \"192.168.1.51\",\n        \"port\": \"6666\",\n        \"user\": \"admin\",\n        \"pass\": \"adminadmin\"\n    }\n}\n```\n\nTo enable qBittorrent integration, follow the setup guide [here](https://github.com/lgallard/qBittorrent-Controller/wiki/How-to-enable-the-qBittorrent-Web-UI).\n\n## REQUESTS Settings\n\n```json\n{\n    \"REQUESTS\": {\n        \"verify\": false,\n        \"timeout\": 20,\n        \"max_retry\": 8\n    }\n}\n```\n\n- `verify`: Verifies SSL certificates\n- `timeout`: Maximum timeout (in seconds) for each request\n- `max_retry`: Number of retry attempts per segment during M3U8 index download\n\n## M3U8_DOWNLOAD Settings\n\n```json\n{\n    \"M3U8_DOWNLOAD\": {\n        \"tqdm_delay\": 0.01,\n        \"default_video_workser\": 12,\n        \"default_audio_workser\": 12,\n        \"segment_timeout\": 8,\n        \"download_audio\": true,\n        \"merge_audio\": true,\n        \"specific_list_audio\": [\n            \"ita\"\n        ],\n        \"download_subtitle\": true,\n        \"merge_subs\": true,\n        \"specific_list_subtitles\": [\n            \"ita\",\n            \"eng\"\n        ],\n        \"cleanup_tmp_folder\": true\n    }\n}\n```\n\n- `tqdm_delay`: Delay between progress bar updates\n- `default_video_workser`: Number of threads for video download\n  * Can be changed from terminal with `--default_video_worker <number>`\n    <br/><br/>\n\n- `default_audio_workser`: Number of threads for audio download\n  * Can be changed from terminal with `--default_audio_worker <number>`\n    <br/><br/>\n\n- `segment_timeout`: Timeout for downloading individual segments\n- `download_audio`: Whether to download audio tracks\n- `merge_audio`: Whether to merge audio with video\n- `specific_list_audio`: List of audio languages to download\n  * Can be changed from terminal with `--specific_list_audio ita,eng`\n    <br/><br/>\n\n- `download_subtitle`: Whether to download subtitles\n- `merge_subs`: Whether to merge subtitles with video\n- `specific_list_subtitles`: List of subtitle languages to download\n  * Can be changed from terminal with `--specific_list_subtitles ita,eng`\n    <br/><br/>\n\n- `cleanup_tmp_folder`: Remove temporary .ts files after download\n\n## Available Language Codes\n\n| European        | Asian           | Middle Eastern  | Others          |\n|-----------------|-----------------|-----------------|-----------------|\n| ita - Italian   | chi - Chinese   | ara - Arabic    | eng - English   |\n| spa - Spanish   | jpn - Japanese  | heb - Hebrew    | por - Portuguese|\n| fre - French    | kor - Korean    | tur - Turkish   | fil - Filipino  |\n| ger - German    | hin - Hindi     |                 | ind - Indonesian|\n| rus - Russian   | mal - Malayalam |                 | may - Malay     |\n| swe - Swedish   | tam - Tamil     |                 | vie - Vietnamese|\n| pol - Polish    | tel - Telugu    |                 |                 |\n| ukr - Ukrainian | tha - Thai      |                 |                 |\n\n## M3U8_CONVERSION Settings\n\n```json\n{\n    \"M3U8_CONVERSION\": {\n        \"use_codec\": false,\n        \"use_vcodec\": true,\n        \"use_acodec\": true,\n        \"use_bitrate\": true,\n        \"use_gpu\": false,\n        \"default_preset\": \"ultrafast\"\n    }\n}\n```\n\n- `use_codec`: Use specific codec settings\n- `use_vcodec`: Use specific video codec\n- `use_acodec`: Use specific audio codec\n- `use_bitrate`: Apply bitrate settings\n- `use_gpu`: Enable GPU acceleration (if available)\n- `default_preset`: FFmpeg encoding preset (ultrafast, fast, medium, slow, etc.)\n\n### Advanced M3U8 Conversion Options\n\nThe software supports various advanced encoding options via FFmpeg:\n\n#### Encoding Presets\nThe `default_preset` configuration can be set to one of the following values:\n- `ultrafast`: Extremely fast conversion but larger file size\n- `superfast`: Very fast with good quality/size ratio\n- `veryfast`: Fast with good compression\n- `faster`: Optimal balance for most users\n- `fast`: Good compression, moderate time\n- `medium`: FFmpeg default setting\n- `slow`: High quality, slower process\n- `slower`: Very high quality, slow process\n- `veryslow`: Maximum quality, very slow process\n\n#### GPU Acceleration\nWhen `use_gpu` is enabled, the system will use available hardware acceleration:\n- NVIDIA: NVENC \n- AMD: AMF\n- Intel: QSV\n\nYou need to have updated drivers and FFmpeg compiled with hardware acceleration support.\n\n## M3U8_PARSER Settings\n\n```json\n{\n    \"M3U8_PARSER\": {\n        \"force_resolution\": \"Best\",\n        \"get_only_link\": false\n    }\n}\n```\n\n- `force_resolution`: Choose the video resolution for downloading:\n    * `\"Best\"`: Highest available resolution\n    * `\"Worst\"`: Lowest available resolution\n    * `\"720p\"`: Force 720p resolution\n    * Or specify one of these resolutions:\n        - 1080p (1920x1080)\n        - 720p (1280x720)\n        - 480p (640x480)\n        - 360p (640x360)\n        - 320p (480x320)\n        - 240p (426x240)\n        - 240p (320x240)\n        - 144p (256x144)\n\n- `get_only_link`: Return M3U8 playlist/index URL instead of downloading\n\n## SITE_EXTRA Settings\n\n```json\n{\n    \"SITE_EXTRA\": {\n        \"ddlstreamitaly\": {\n            \"ips4_device_key\": \"\",\n            \"ips4_member_id\": \"\",\n            \"ips4_login_key\": \"\"\n        }\n    }\n}\n```\n\n- Site-specific configuration for `ddlstreamitaly`:\n  - `ips4_device_key`: Device key for authentication\n  - `ips4_member_id`: Member ID for authentication\n  - `ips4_login_key`: Login key for authentication\n  \n## Update Domains\n\nThere are two ways to update the domains for the supported websites:\n\n### 1. Using Local Configuration\n\n1. Create a `domains.json` file in the root directory of the project\n\n2. Add your domain configuration in the following format:\n   ```json\n   {\n      \"altadefinizione\": {\n          \"domain\": \"si\",\n          \"full_url\": \"https://altadefinizione.si/\"\n      },\n      ...\n   }\n   ```\n   \n3. Set `use_api` to `false` in the `DEFAULT` section of your `config.json`:\n   ```json\n   {\n      \"DEFAULT\": {\n         \"use_api\": false\n      }\n   }\n   ```\n\n### 2. Using API (Legacy)\n\nThe API-based domain updates are currently deprecated. To use it anyway, set `use_api` to `true` in your `config.json` file.\n\nNote: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.\n\n# COMMAND\n\n- Download a specific season by entering its number.\n  *  **Example:** `1` will download *Season 1* only.\n\n-  Use the wildcard `*` to download every available season.\n   * **Example:** `*` will download all seasons in the series.\n\n- Specify a range of seasons using a hyphen `-`.\n   * **Example:** `1-2` will download *Seasons 1 and 2*.\n\n- Enter a season number followed by `-*` to download from that season to the end.\n  * **Example:** `3-*` will download from *Season 3* to the final season.\n\n# Examples of terminal usage\n\n```bash\n# Change video and audio workers\npython test_run.py --default_video_worker 8 --default_audio_worker 8\n\n# Set specific languages\npython test_run.py --specific_list_audio ita,eng --specific_list_subtitles eng,spa\n\n# Keep console open after download\npython test_run.py --not_close true\n```\n\n# Docker\n\nYou can run the script in a docker container, to build the image just run\n\n```\ndocker build -t streaming-community-api .\n```\n\nand to run it use\n\n```\ndocker run -it -p 8000:8000 streaming-community-api\n```\n\nBy default the videos will be saved in `/app/Video` inside the container, if you want to to save them in your machine instead of the container just run\n\n```\ndocker run -it -p 8000:8000 -v /path/to/download:/app/Video streaming-community-api\n```\n\n### Docker quick setup with Make\n\nInside the Makefile (install `make`) are already configured two commands to build and run the container:\n\n```\nmake build-container\n\n# set your download directory as ENV variable\nmake LOCAL_DIR=/path/to/download run-container\n```\n\nThe `run-container` command mounts also the `config.json` file, so any change to the configuration file is reflected immediately without having to rebuild the image.\n\n# Telegram Usage\n\n## Configuration\n\nThe bot was created to replace terminal commands and allow interaction via Telegram. Each download runs within a screen session, enabling multiple downloads to run simultaneously.\n\nTo run the bot in the background, simply start it inside a screen session and then press Ctrl + A, followed by D, to detach from the session without stopping the bot.\n\nCommand Functions:\n\n\ud83d\udd39 /start \u2013 Starts a new search for a download. This command performs the same operations as manually running the script in the terminal with test_run.py.\n\n\ud83d\udd39 /list \u2013 Displays the status of active downloads, with options to:\n\nStop an incorrect download using /stop <ID>.\n\nView the real-time output of a download using /screen <ID>.\n\n\u26a0 Warning: If a download is interrupted, incomplete files may remain in the folder specified in config.json. These files must be deleted manually to avoid storage or management issues.\n\n\ud83d\udee0 Configuration: Currently, the bot's settings are stored in the config.json file, which is located in the same directory as the telegram_bot.py script.\n\n## .env Example:\n\nYou need to create an .env file and enter your Telegram token and user ID to authorize only one user to use it\n\n```\nTOKEN_TELEGRAM=IlTuo2131TOKEN$12D3Telegram\nAUTHORIZED_USER_ID=12345678\nDEBUG=False\n```\n\n## Install Python Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n## On Linux/MacOS:\n\nStart the bot from the folder /StreamingCommunity/TelegramHelp\n\n```bash\npython3 telegram_bot.py\n```\n\n# Tutorials\n\n- [Windows Tutorial](https://www.youtube.com/watch?v=mZGqK4wdN-k)\n- [Linux Tutorial](https://www.youtube.com/watch?v=0qUNXPE_mTg)\n- [Pypy Tutorial](https://www.youtube.com/watch?v=C6m9ZKOK0p4)\n- [Compiled .exe Tutorial](https://www.youtube.com/watch?v=pm4lqsxkTVo)\n\n# To Do\n\n- To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)\n- To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)\n\n# Contributing\n\nContributions are welcome! Steps:\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to branch (`git push origin feature/AmazingFeature`)\n5. Open Pull Request\n\n\n# Disclaimer\n\nThis software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.\n\n## Contributors\n\n<a href=\"https://github.com/Arrowar/StreamingCommunity/graphs/contributors\" alt=\"View Contributors\">\n  <img src=\"https://contrib.rocks/image?repo=Arrowar/StreamingCommunity&max=1000&columns=10\" alt=\"Contributors\" />\n</a>\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "2.9.1",
    "project_urls": {
        "Bug Reports": "https://github.com/Lovi-0/StreamingCommunity/issues",
        "Homepage": "https://github.com/Lovi-0/StreamingCommunity",
        "Source": "https://github.com/Lovi-0/StreamingCommunity"
    },
    "split_keywords": [
        "streaming",
        "community"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9c17ccd975c9a2bbb44a5450b98ee11b06485c41d81b4661f34d45b6efb2344f",
                "md5": "eb36ee58310b052e5656cd75d44a207e",
                "sha256": "2098ce273b2cae2eef8ca47441a50ebae7558e34ba2fa3beb89c16e51c13ac42"
            },
            "downloads": -1,
            "filename": "StreamingCommunity-2.9.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eb36ee58310b052e5656cd75d44a207e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 136303,
            "upload_time": "2025-03-02T13:39:56",
            "upload_time_iso_8601": "2025-03-02T13:39:56.728705Z",
            "url": "https://files.pythonhosted.org/packages/9c/17/ccd975c9a2bbb44a5450b98ee11b06485c41d81b4661f34d45b6efb2344f/StreamingCommunity-2.9.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0c8b7966d65e004f9995b3ec6aeef108f6af3bc579829979d0a8a4132b25795e",
                "md5": "3955a19efab37c75d9456af60b9555a8",
                "sha256": "4e1c4bfdad56ac26923160eb6a3b6afe9f1c577b2cf1e70f9f641f3a276a48b6"
            },
            "downloads": -1,
            "filename": "StreamingCommunity-2.9.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3955a19efab37c75d9456af60b9555a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 106793,
            "upload_time": "2025-03-02T13:39:57",
            "upload_time_iso_8601": "2025-03-02T13:39:57.984403Z",
            "url": "https://files.pythonhosted.org/packages/0c/8b/7966d65e004f9995b3ec6aeef108f6af3bc579829979d0a8a4132b25795e/StreamingCommunity-2.9.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-02 13:39:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Lovi-0",
    "github_project": "StreamingCommunity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "streamingcommunity"
}
        
Elapsed time: 3.91287s