diff --git a/.gitignore b/.gitignore index 7e70cb5..c1fc56a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +*.pyc # PyInstaller *.manifest @@ -34,6 +35,7 @@ note.txt list_proxy.txt cmd.txt downloaded_files +key.t # Cache __pycache__/ @@ -42,4 +44,4 @@ __pycache__/ /client/dashboard/node_modules # Ignore build directory in the client dashboard to avoid committing build artifacts -/client/dashboard/build \ No newline at end of file +/client/dashboard/build diff --git a/README.md b/README.md index 3924c15..19b85a6 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ Per testare 1. Installare requirements -2. Inserire url per mongodb e creare database -3. Runnare server.py +1. Installare node js: https://nodejs.org/en/download/package-manager +2. Inserire url per mongodb. Pagina login: https://account.mongodb.com/account/login +3. Eseguire server.py: python server.py 4. Spostarsi su client\dashboard -5. Eseguire npm install, npm run build, npm install -g serve +5. Eseguire npm install, npm run build, npm install -g serve, serve -s build -Cosa da fare +Cosa da fare: - Aggiungere documentazione -- Bottone download intera stagione -- Messaggio con richiesta se scaricare le nuove stagione quando si fa il check in watchlist -- Migliore player in case watch con bottone +- Migliore player quando si clicca sul button watch. - Coda di download con bottone aggiungere alla coda (complessa) +- Progresso di download (complesso) ... \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/streamingcommunity/api.py b/StreamingCommunity/Api/Site/streamingcommunity/api.py index d829833..e84295b 100644 --- a/StreamingCommunity/Api/Site/streamingcommunity/api.py +++ b/StreamingCommunity/Api/Site/streamingcommunity/api.py @@ -87,14 +87,6 @@ def get_infoSelectTitle(url_title: str, domain: str, version: str): if response.status_code == 200: json_response = response.json()['props'] - generes = [] - for g in json_response["genres"]: - generes.append(g["name"]) - - trailer = None - if len(json_response['title']['trailers']) > 0: - trailer = f"https://www.youtube.com/watch?v={json_response['title']['trailers'][0]['youtube_id']}" - images = {} for dict_image in json_response['title'].get('images', []): images[dict_image.get('type')] = f"https://cdn.{SITE_NAME}.{domain}/images/{dict_image.get('filename')}" @@ -106,8 +98,6 @@ def get_infoSelectTitle(url_title: str, domain: str, version: str): 'plot': json_response['title']['plot'], 'type': json_response['title']['type'], 'season_count': json_response['title']['seasons_count'], - 'generes': generes, - 'trailer': trailer, 'image': images } diff --git a/client/dashboard/src/components/ApiUrl.js b/client/dashboard/src/components/ApiUrl.js new file mode 100644 index 0000000..b6d927b --- /dev/null +++ b/client/dashboard/src/components/ApiUrl.js @@ -0,0 +1,6 @@ +export const API_BASE_URL = "http://127.0.0.1:1234"; + +export const API_URL = `${API_BASE_URL}/api`; +export const SERVER_WATCHLIST_URL = `${API_BASE_URL}/server/watchlist`; +export const SERVER_PATH_URL = `${API_BASE_URL}/server/path`; +export const SERVER_DELETE_URL = `${API_BASE_URL}/server/delete`; \ No newline at end of file diff --git a/client/dashboard/src/components/Dashboard.js b/client/dashboard/src/components/Dashboard.js index cb0fa55..c5c6739 100644 --- a/client/dashboard/src/components/Dashboard.js +++ b/client/dashboard/src/components/Dashboard.js @@ -3,8 +3,7 @@ import axios from 'axios'; import { Container, Button, Form, InputGroup } from 'react-bootstrap'; import SearchBar from './SearchBar.js'; - -const API_BASE_URL = "http://127.0.0.1:1234"; +import { API_BASE_URL } from './ApiUrl.js'; const Dashboard = () => { const [items, setItems] = useState([]); diff --git a/client/dashboard/src/components/Downloads.js b/client/dashboard/src/components/Downloads.js index 54d98bc..c50ddad 100644 --- a/client/dashboard/src/components/Downloads.js +++ b/client/dashboard/src/components/Downloads.js @@ -1,10 +1,9 @@ import React, { useState, useEffect } from 'react'; import axios from 'axios'; -import { Container, Row, Col, Card, Button, Badge, Modal } from 'react-bootstrap'; +import { Container, Row, Col, Card, Button, Modal } from 'react-bootstrap'; // Aggiungi Modal qui import { FaTrash, FaPlay } from 'react-icons/fa'; -import { Link } from 'react-router-dom'; -const API_BASE_URL = "http://127.0.0.1:1234"; +import { SERVER_PATH_URL, SERVER_DELETE_URL, API_URL } from './ApiUrl'; const Downloads = () => { const [downloads, setDownloads] = useState([]); @@ -15,7 +14,7 @@ const Downloads = () => { // Fetch all downloads const fetchDownloads = async () => { try { - const response = await axios.get(`${API_BASE_URL}/downloads`); + const response = await axios.get(`${SERVER_PATH_URL}/getAll`); setDownloads(response.data); setLoading(false); } catch (error) { @@ -27,8 +26,8 @@ const Downloads = () => { // Delete a TV episode const handleDeleteEpisode = async (id, season, episode) => { try { - await axios.delete(`${API_BASE_URL}/deleteEpisode`, { - params: { id, season, episode } + await axios.delete(`${SERVER_DELETE_URL}/episode`, { + params: { series_id: id, season_number: season, episode_number: episode } }); fetchDownloads(); // Refresh the list } catch (error) { @@ -39,8 +38,8 @@ const Downloads = () => { // Delete a movie const handleDeleteMovie = async (id) => { try { - await axios.delete(`${API_BASE_URL}/deleteMovie`, { - params: { id } + await axios.delete(`${SERVER_DELETE_URL}/movie`, { + params: { movie_id: id } }); fetchDownloads(); // Refresh the list } catch (error) { @@ -111,13 +110,6 @@ const Downloads = () => { > Watch - - View Details - @@ -160,13 +152,6 @@ const Downloads = () => { > Watch - - View Details - @@ -181,7 +166,7 @@ const Downloads = () => { setShowPlayer(false)} size="lg" centered>