Skip to content

Commit cd3001f

Browse files
committed
Un giorno ...
1 parent d82133f commit cd3001f

33 files changed

+3347
-1153
lines changed

.gitignore

Lines changed: 127 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,128 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
15

2-
# Folder
3-
bin
4-
lib64
5-
*__pycache__
6-
pyvenv.cfg
7-
.idea
8-
9-
# Project specific
10-
videos/
11-
tmp/
12-
debug.log
13-
run.exe
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
cover/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
db.sqlite3-journal
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
.pybuilder/
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
.pdm.toml
83+
84+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
85+
__pypackages__/
86+
87+
# Celery stuff
88+
celerybeat-schedule
89+
celerybeat.pid
90+
91+
# SageMath parsed files
92+
*.sage.py
93+
94+
# Environments
95+
.env
96+
.venv
97+
env/
98+
venv/
99+
ENV/
100+
env.bak/
101+
venv.bak/
102+
103+
# Spyder project settings
104+
.spyderproject
105+
.spyproject
106+
107+
# Rope project settings
108+
.ropeproject
109+
110+
# mkdocs documentation
111+
/site
112+
113+
# mypy
114+
.mypy_cache/
115+
.dmypy.json
116+
dmypy.json
117+
118+
# Pyre type checker
119+
.pyre/
120+
121+
# pytype static type analyzer
122+
.pytype/
123+
124+
# Cython debug symbols
125+
cython_debug/
126+
127+
# Other
128+
Video
File renamed without changes.

README.md

Lines changed: 94 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,153 @@
1-
<p align="center">
2-
<img src="Src/Assets/min_logo.png" style="max-width: 55%;" alt="video working" />
1+
<p align="center" >
2+
<img src="./Src/Assets/min_logo.png" title="SDWebImage logo" float=left>
33
</p>
44

5-
## Overview.
5+
# Overview.
6+
67
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.
78

89
## Join us
9-
You can chat, help improve this repo, or just hang around for some fun in the **Git_StreamingCommunity** Discord [Server](https://discord.gg/c3JSUM5Hqw)
10-
10+
You can chat, help improve this repo, or just hang around for some fun in the **Git_StreamingCommunity** Discord [Server](https://discord.gg/by8UsqhPWx)
1111
# Table of Contents
12+
1213
* [INSTALLATION](#installation)
13-
* [Requirement](#requirement)
14-
* [Usage](#usage)
15-
* [Update](#update)
1614

17-
* [FEATURES](#features)
15+
* [Requirement](#requirement)
16+
* [Usage](#usage)
17+
* [Update](#update)
1818
* [USAGE AND OPTIONS](#options)
1919
* [TUTORIAL](#tutorial)
2020

2121
## Requirement
22+
2223
Make sure you have the following prerequisites installed on your system:
24+
2325
* python > [3.11](https://www.python.org/downloads/)
2426
* ffmpeg [win](https://www.gyan.dev/ffmpeg/builds/)
2527

26-
2728
## Installation
29+
2830
Install the required Python libraries using the following command:
31+
2932
```
3033
pip install -r requirements.txt
3134
```
3235

3336
## Usage
37+
3438
Run the script with the following command:
3539

3640
#### On Windows:
41+
3742
```powershell
3843
python run.py
3944
```
4045

4146
#### On Linux/MacOS:
47+
4248
```bash
4349
python3 run.py
4450
```
4551

46-
4752
## Update
53+
4854
Keep your script up to date with the latest features by running:
4955

5056
#### On Windows:
57+
5158
```powershell
5259
python update.py
5360
```
5461

5562
#### On Linux/MacOS:
63+
5664
```bash
5765
python3 update.py
5866
```
5967

60-
61-
## Features
62-
- Download Single Film: Easily download individual movies with a simple command.
63-
- 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 (*).
64-
- Download Subtitles: Automatically fetch subtitles if available for downloaded content. (Note: To disable this feature, see [Configuration](#configuration))
65-
- Sync Audio and Video: Ensure perfect synchronization between audio and video during the download process for an enhanced viewing experience.
66-
6768
## Configuration
69+
6870
You can change some behaviors by tweaking the configuration file.
6971

7072
```json
7173
{
72-
"root_path": "videos",
73-
"movies_folder_name": "Movies",
74-
"series_folder_name": "Series",
75-
"download_subtitles": true,
76-
"download_default_language": true,
77-
"selected_language": "English",
78-
"max_worker": 20
74+
"DEFAULT": {
75+
"debug": false,
76+
"get_info": false,
77+
"show_message": true,
78+
"clean_console": true,
79+
"get_moment_title": false,
80+
"root_path": "videos",
81+
"movies_folder_name": "Movies",
82+
"series_folder_name": "Series",
83+
"anime_folder_name": "Anime",
84+
"not_close": false,
85+
"swith_anime": false
86+
},
87+
"SITE": {
88+
"streaming_site_name": "streamingcommunity",
89+
"streaming_domain": "forum",
90+
"anime_site_name": "animeunity",
91+
"anime_domain": "to"
92+
},
93+
"M3U8": {
94+
"tdqm_workers": 20,
95+
"tqdm_progress_timeout": 10,
96+
"minium_ts_files_in_folder": 15,
97+
"donwload_percentage": 1,
98+
"requests_timeout": 5,
99+
"enable_time_quit": false,
100+
"tqdm_show_progress": false,
101+
"cleanup_tmp_folder": true
102+
},
103+
"M3U8_OPTIONS": {
104+
"download_audio": true,
105+
"download_subtitles": true,
106+
"specific_list_audio": [
107+
"ita"
108+
],
109+
"specific_list_subtitles": [
110+
"eng"
111+
],
112+
}
79113
}
80-
81114
```
115+
82116
#### Options
83-
| Key | Default Value | Description | Value Example |
84-
|---------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------|
85-
| 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 |
86-
| movies_folder_name | Movies | The folder name where all the movies will be placed. Do not put trailing slash. | downloaded-movies |
87-
| series_folder_name | Series | The folder name where all the TV Series will be placed. Do not put trailing slash. | mytvseries |
88-
| download_subtitles | true | Whether or not you want all the found subtitles to be downloaded. | false |
89-
| download_default_language | true | Whether or not you want to download only the default Italian audio language. | false |
90-
| selected_language | English | If `"download_default_language"` is `False` the script will download this language. | French |
91-
| max_worker | 20 | How many workers will cooperate to download .ts file. **High value may slow down your pc**. | 30 |
117+
118+
| Key | Default Value | Description | Value Example |
119+
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
120+
| DEFAULT | | Contains default configuration options for users. | |
121+
| debug | false | Whether debugging information should be displayed or not. | true |
122+
| get_info | false | Whether additional information should be fetched or not with debug enable. | true |
123+
| show_message | true | Whether messages should be displayed to the user or not. | false |
124+
| clean_console | true | Whether the console should be cleared before displaying new information or not. | false |
125+
| get_moment_title | false | Whether to fetch the title of the moment or not. | true |
126+
| root_path | videos | Path where the script will add movies and TV series folders (see[Path Examples](#Path-examples)). | media/streamingcommunity |
127+
| movies_folder_name | Movies | The folder name where all the movies will be placed. Do not put a trailing slash. | downloaded-movies |
128+
| series_folder_name | Series | The folder name where all the TV series will be placed. Do not put a trailing slash. | mytvseries |
129+
| anime_folder_name | Anime | The folder name where all the anime will be placed. Do not put a trailing slash. | myanime |
130+
| not_close | false | Whether to keep the application running after completion or not. | true |
131+
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
132+
| SITE | | Contains site-specific configuration options. | |
133+
| streaming_domain | forum | The domain of the streaming site. | express |
134+
| anime_domain | to | The domain of the anime site. | estate |
135+
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
136+
| M3U8 | | Contains options specific to M3U8. | |
137+
| tdqm_workers | 20 | The number of workers that will cooperate to download .ts files.**A high value may slow down your PC** | 40 |
138+
| tqdm_progress_timeout | 10 | The timeout duration for progress display updates in seconds after quit download. | 5 |
139+
| minium_ts_files_in_folder | 15 | The minimum number of .ts files expected in a folder. | 10 |
140+
| donwload_percentage | 1 | The percentage of download completion required to consider the download complete. | 0.95 |
141+
| requests_timeout | 5 | The timeout duration for HTTP requests in seconds. | 10 |
142+
| enable_time_quit | false | Whether to enable quitting the download after a certain time period. | true |
143+
| tqdm_show_progress | false | Whether to show progress during downloads or not.**May slow down your PC** | true |
144+
| cleanup_tmp_folder | true | Whether to clean up temporary folders after processing or not. | false |
145+
| -------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
146+
| M3U8_OPTIONS | | Contains options specific to M3U8 file format. | |
147+
| download_audio | true | Indicates whether audio files should be downloaded or not. | false |
148+
| download_subtitles | true | Indicates whether subtitles should be downloaded or not. | false |
149+
| specific_list_audio | ["ita"] | A list of specific audio languages to download. | ["eng", "fra"] |
150+
| specific_list_subtitles | ["eng"] | A list of specific subtitle languages to download. | ["spa", "por"] |
92151

93152
> [!IMPORTANT]
94153
> If you're on **Windows** you'll need to use double black slashes. On Linux/MacOS, one slash is fine.

Src/Api/Class/EpisodeType.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# 03.03.24
2+
3+
from typing import Dict, Any, List
4+
5+
class Episode:
6+
def __init__(self, data: Dict[str, Any]):
7+
"""
8+
Initialize an Episode object.
9+
10+
Args:
11+
data (Dict[str, Any]): A dictionary containing data for the episode.
12+
"""
13+
self.id: int = data.get('id', '')
14+
self.number: int = data.get('number', '')
15+
self.name: str = data.get('name', '')
16+
self.plot: str = data.get('plot', '')
17+
self.duration: int = data.get('duration', '')
18+
self.scws_id: int = data.get('scws_id', '')
19+
self.season_id: int = data.get('season_id', '')
20+
self.created_by: str = data.get('created_by', '')
21+
self.created_at: str = data.get('created_at', '')
22+
self.updated_at: str = data.get('updated_at', '')
23+
24+
class EpisodeManager:
25+
def __init__(self):
26+
"""
27+
Initialize an EpisodeManager object.
28+
"""
29+
self.episodes: List[Episode] = []
30+
31+
def add_episode(self, episode_data: Dict[str, Any]):
32+
"""
33+
Add a new episode to the manager.
34+
35+
Args:
36+
episode_data (Dict[str, Any]): A dictionary containing data for the new episode.
37+
"""
38+
episode = Episode(episode_data)
39+
self.episodes.append(episode)
40+
41+
def get_episode_by_index(self, index: int) -> Episode:
42+
"""
43+
Get an episode by its index.
44+
45+
Args:
46+
index (int): Index of the episode to retrieve.
47+
48+
Returns:
49+
Episode: The episode object.
50+
"""
51+
return self.episodes[index]
52+
53+
def get_length(self) -> int:
54+
"""
55+
Get the number of episodes in the manager.
56+
57+
Returns:
58+
int: Number of episodes.
59+
"""
60+
return len(self.episodes)

0 commit comments

Comments
 (0)