Skip to content

Commit

Permalink
Un giorno ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovi-0 committed Apr 1, 2024
1 parent d82133f commit cd3001f
Show file tree
Hide file tree
Showing 33 changed files with 3,347 additions and 1,153 deletions.
139 changes: 127 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,128 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Folder
bin
lib64
*__pycache__
pyvenv.cfg
.idea

# Project specific
videos/
tmp/
debug.log
run.exe
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Other
Video
File renamed without changes.
129 changes: 94 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,153 @@
<p align="center">
<img src="Src/Assets/min_logo.png" style="max-width: 55%;" alt="video working" />
<p align="center" >
<img src="./Src/Assets/min_logo.png" title="SDWebImage logo" float=left>
</p>

## Overview.
# Overview.

This repository provide a simple script designed to facilitate the downloading of films and series from a popular streaming community platform. The script allows users to download individual films, entire series, or specific episodes, providing a seamless experience for content consumers.

## Join us
You can chat, help improve this repo, or just hang around for some fun in the **Git_StreamingCommunity** Discord [Server](https://discord.gg/c3JSUM5Hqw)

You can chat, help improve this repo, or just hang around for some fun in the **Git_StreamingCommunity** Discord [Server](https://discord.gg/by8UsqhPWx)
# Table of Contents

* [INSTALLATION](#installation)
* [Requirement](#requirement)
* [Usage](#usage)
* [Update](#update)

* [FEATURES](#features)
* [Requirement](#requirement)
* [Usage](#usage)
* [Update](#update)
* [USAGE AND OPTIONS](#options)
* [TUTORIAL](#tutorial)

## Requirement

Make sure you have the following prerequisites installed on your system:

* python > [3.11](https://www.python.org/downloads/)
* ffmpeg [win](https://www.gyan.dev/ffmpeg/builds/)


## Installation

Install the required Python libraries using the following command:

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

## Usage

Run the script with the following command:

#### On Windows:

```powershell
python run.py
```

#### On Linux/MacOS:

```bash
python3 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
```


## Features
- Download Single Film: Easily download individual movies with a simple command.
- Download Specific Episodes or Entire Series: Seamlessly retrieve specific episodes or entire series using intuitive commands. Specify a range of episodes with square brackets notation, e.g., [5-7], or download all episodes with an asterisk (*).
- Download Subtitles: Automatically fetch subtitles if available for downloaded content. (Note: To disable this feature, see [Configuration](#configuration))
- Sync Audio and Video: Ensure perfect synchronization between audio and video during the download process for an enhanced viewing experience.

## Configuration

You can change some behaviors by tweaking the configuration file.

```json
{
"root_path": "videos",
"movies_folder_name": "Movies",
"series_folder_name": "Series",
"download_subtitles": true,
"download_default_language": true,
"selected_language": "English",
"max_worker": 20
"DEFAULT": {
"debug": false,
"get_info": false,
"show_message": true,
"clean_console": true,
"get_moment_title": false,
"root_path": "videos",
"movies_folder_name": "Movies",
"series_folder_name": "Series",
"anime_folder_name": "Anime",
"not_close": false,
"swith_anime": false
},
"SITE": {
"streaming_site_name": "streamingcommunity",
"streaming_domain": "forum",
"anime_site_name": "animeunity",
"anime_domain": "to"
},
"M3U8": {
"tdqm_workers": 20,
"tqdm_progress_timeout": 10,
"minium_ts_files_in_folder": 15,
"donwload_percentage": 1,
"requests_timeout": 5,
"enable_time_quit": false,
"tqdm_show_progress": false,
"cleanup_tmp_folder": true
},
"M3U8_OPTIONS": {
"download_audio": true,
"download_subtitles": true,
"specific_list_audio": [
"ita"
],
"specific_list_subtitles": [
"eng"
],
}
}

```

#### Options
| Key | Default Value | Description | Value Example |
|---------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------|
| root_path | videos | Path where the script will add movies and tv series folders (see [Path Examples](#Path-examples)). Do not put trailing slash. | media/streamingcommunity |
| movies_folder_name | Movies | The folder name where all the movies will be placed. Do not put trailing slash. | downloaded-movies |
| series_folder_name | Series | The folder name where all the TV Series will be placed. Do not put trailing slash. | mytvseries |
| download_subtitles | true | Whether or not you want all the found subtitles to be downloaded. | false |
| download_default_language | true | Whether or not you want to download only the default Italian audio language. | false |
| selected_language | English | If `"download_default_language"` is `False` the script will download this language. | French |
| max_worker | 20 | How many workers will cooperate to download .ts file. **High value may slow down your pc**. | 30 |

| Key | Default Value | Description | Value Example |
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| DEFAULT | | Contains default configuration options for users. | |
| debug | false | Whether debugging information should be displayed or not. | true |
| get_info | false | Whether additional information should be fetched or not with debug enable. | true |
| show_message | true | Whether messages should be displayed to the user or not. | false |
| clean_console | true | Whether the console should be cleared before displaying new information or not. | false |
| get_moment_title | false | Whether to fetch the title of the moment or not. | true |
| root_path | videos | Path where the script will add movies and TV series folders (see[Path Examples](#Path-examples)). | media/streamingcommunity |
| movies_folder_name | Movies | The folder name where all the movies will be placed. Do not put a trailing slash. | downloaded-movies |
| series_folder_name | Series | The folder name where all the TV series will be placed. Do not put a trailing slash. | mytvseries |
| anime_folder_name | Anime | The folder name where all the anime will be placed. Do not put a trailing slash. | myanime |
| not_close | false | Whether to keep the application running after completion or not. | true |
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| SITE | | Contains site-specific configuration options. | |
| streaming_domain | forum | The domain of the streaming site. | express |
| anime_domain | to | The domain of the anime site. | estate |
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| M3U8 | | Contains options specific to M3U8. | |
| tdqm_workers | 20 | The number of workers that will cooperate to download .ts files.**A high value may slow down your PC** | 40 |
| tqdm_progress_timeout | 10 | The timeout duration for progress display updates in seconds after quit download. | 5 |
| minium_ts_files_in_folder | 15 | The minimum number of .ts files expected in a folder. | 10 |
| donwload_percentage | 1 | The percentage of download completion required to consider the download complete. | 0.95 |
| requests_timeout | 5 | The timeout duration for HTTP requests in seconds. | 10 |
| enable_time_quit | false | Whether to enable quitting the download after a certain time period. | true |
| tqdm_show_progress | false | Whether to show progress during downloads or not.**May slow down your PC** | true |
| cleanup_tmp_folder | true | Whether to clean up temporary folders after processing or not. | false |
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| M3U8_OPTIONS | | Contains options specific to M3U8 file format. | |
| download_audio | true | Indicates whether audio files should be downloaded or not. | false |
| download_subtitles | true | Indicates whether subtitles should be downloaded or not. | false |
| specific_list_audio | ["ita"] | A list of specific audio languages to download. | ["eng", "fra"] |
| specific_list_subtitles | ["eng"] | A list of specific subtitle languages to download. | ["spa", "por"] |

> [!IMPORTANT]
> If you're on **Windows** you'll need to use double black slashes. On Linux/MacOS, one slash is fine.
Expand Down
60 changes: 60 additions & 0 deletions Src/Api/Class/EpisodeType.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 03.03.24

from typing import Dict, Any, List

class Episode:
def __init__(self, data: Dict[str, Any]):
"""
Initialize an Episode object.
Args:
data (Dict[str, Any]): A dictionary containing data for the episode.
"""
self.id: int = data.get('id', '')
self.number: int = data.get('number', '')
self.name: str = data.get('name', '')
self.plot: str = data.get('plot', '')
self.duration: int = data.get('duration', '')
self.scws_id: int = data.get('scws_id', '')
self.season_id: int = data.get('season_id', '')
self.created_by: str = data.get('created_by', '')
self.created_at: str = data.get('created_at', '')
self.updated_at: str = data.get('updated_at', '')

class EpisodeManager:
def __init__(self):
"""
Initialize an EpisodeManager object.
"""
self.episodes: List[Episode] = []

def add_episode(self, episode_data: Dict[str, Any]):
"""
Add a new episode to the manager.
Args:
episode_data (Dict[str, Any]): A dictionary containing data for the new episode.
"""
episode = Episode(episode_data)
self.episodes.append(episode)

def get_episode_by_index(self, index: int) -> Episode:
"""
Get an episode by its index.
Args:
index (int): Index of the episode to retrieve.
Returns:
Episode: The episode object.
"""
return self.episodes[index]

def get_length(self) -> int:
"""
Get the number of episodes in the manager.
Returns:
int: Number of episodes.
"""
return len(self.episodes)
Loading

0 comments on commit cd3001f

Please sign in to comment.