diff --git a/README.md b/README.md index d8822a7..7a96a7c 100644 --- a/README.md +++ b/README.md @@ -238,14 +238,13 @@ Benefits: Ideal for users who want a reliable, plug-and-play solution without the technical overhead of self-hosting. -### Option 3: Hugging Face Space Deployment (Unofficial) +### Option 3: Hugging Face Space Deployment (Guide from a MediaFlow Contributor) 1. Go to this repo and create a fork: https://github.com/UrloMythus/UnHided -2. Signup or Login to Hugging Face https://huggingface.co/ -3. Create a new space with random name https://huggingface.co/new-space. Choose docker as SDK and blank template and public visibility. -4. Goto "Settings" tab and create a new secret with name `API_PASSWORD` and set the value to your desired password. -5. Goto "Files" tab and create a new file with name `Dockerfile` and paste the following content. After that replace ``` YourUsername/YourRepoName``` in the Dockerfile with your Username and the name of your fork. Finally click on "Commit" to save the changes. Remember your space might get banned if instead of using your fork you use the main repo. +2. Sign up or log in to Hugging Face: https://huggingface.co/ +3. Create a new space with a random name: https://huggingface.co/new-space. Choose Docker as SDK and blank template and public visibility. +4. Go to the "Settings" tab and create a new secret with the name `API_PASSWORD` and set the value to your desired password. +5. Go to the "Files" tab and create a new file with the name `Dockerfile` and paste the following content. After that, replace `YourUsername/YourRepoName` in the Dockerfile with your username and the name of your fork. Finally, click on "Commit" to save the changes. Remember, your space might get banned if instead of using your fork, you use the main repo. ```dockerfile - FROM python:3.10-slim-buster WORKDIR /app @@ -259,10 +258,10 @@ Ideal for users who want a reliable, plug-and-play solution without the technica EXPOSE 7860 CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"] ``` -6. Wait until the space gets built and deployed. -7. If the space is deployed successfully, you can click on the three dots in the top right corner and click on "Embed this space" and copy "Direct URL". -8. In order to update your proxy to newest release go to your Github Fork and click on Sync. After that hop on your Hugging Face Space -> Settings and click on Factory Rebuild. -8. Use the above URL and API password on support addons like MediaFusion, MammaMia, Jackettio, etc. +6. Wait until the space gets built and deployed. +7. If the space is deployed successfully, you can click on the three dots in the top right corner and click on "Embed this space" and copy the "Direct URL". +8. To update your proxy to the newest release, go to your GitHub fork and click on Sync. After that, hop on your Hugging Face Space -> Settings and click on Factory Rebuild. +9. Use the above URL and API password on support addons like MediaFusion, MammaMia, Jackettio, etc. ## Usage diff --git a/mediaflow_proxy/extractors/factory.py b/mediaflow_proxy/extractors/factory.py index e22b33b..09855df 100644 --- a/mediaflow_proxy/extractors/factory.py +++ b/mediaflow_proxy/extractors/factory.py @@ -3,15 +3,13 @@ from typing import Dict, Type from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError from mediaflow_proxy.extractors.doodstream import DoodStreamExtractor from mediaflow_proxy.extractors.livetv import LiveTVExtractor +from mediaflow_proxy.extractors.maxstream import MaxstreamExtractor from mediaflow_proxy.extractors.mixdrop import MixdropExtractor -from mediaflow_proxy.extractors.uqload import UqloadExtractor +from mediaflow_proxy.extractors.okru import OkruExtractor from mediaflow_proxy.extractors.streamtape import StreamtapeExtractor from mediaflow_proxy.extractors.supervideo import SupervideoExtractor +from mediaflow_proxy.extractors.uqload import UqloadExtractor from mediaflow_proxy.extractors.vixcloud import VixCloudExtractor -from mediaflow_proxy.extractors.okru import OkruExtractor -from mediaflow_proxy.extractors.maxstream import MaxstreamExtractor - - class ExtractorFactory: diff --git a/mediaflow_proxy/extractors/maxstream.py b/mediaflow_proxy/extractors/maxstream.py index bafb293..707368e 100644 --- a/mediaflow_proxy/extractors/maxstream.py +++ b/mediaflow_proxy/extractors/maxstream.py @@ -1,6 +1,6 @@ import re -import string from typing import Dict, Any + from bs4 import BeautifulSoup from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError diff --git a/mediaflow_proxy/extractors/okru.py b/mediaflow_proxy/extractors/okru.py index 2327866..483e888 100644 --- a/mediaflow_proxy/extractors/okru.py +++ b/mediaflow_proxy/extractors/okru.py @@ -1,10 +1,9 @@ -import re -from bs4 import BeautifulSoup, SoupStrainer import json - from typing import Dict, Any -from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError +from bs4 import BeautifulSoup, SoupStrainer + +from mediaflow_proxy.extractors.base import BaseExtractor class OkruExtractor(BaseExtractor): diff --git a/mediaflow_proxy/extractors/supervideo.py b/mediaflow_proxy/extractors/supervideo.py index ba0fc6b..8ff0e96 100644 --- a/mediaflow_proxy/extractors/supervideo.py +++ b/mediaflow_proxy/extractors/supervideo.py @@ -1,7 +1,7 @@ import re from typing import Dict, Any -from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError +from mediaflow_proxy.extractors.base import BaseExtractor class SupervideoExtractor(BaseExtractor): diff --git a/mediaflow_proxy/extractors/vixcloud.py b/mediaflow_proxy/extractors/vixcloud.py index bdf7f65..696fced 100644 --- a/mediaflow_proxy/extractors/vixcloud.py +++ b/mediaflow_proxy/extractors/vixcloud.py @@ -1,10 +1,11 @@ +import json import re from typing import Dict, Any +from urllib.parse import urlparse, parse_qs + from bs4 import BeautifulSoup, SoupStrainer + from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError -import json -from urllib.parse import urlparse, parse_qs -from urllib.parse import urlparse, parse_qs class VixCloudExtractor(BaseExtractor): @@ -16,13 +17,12 @@ class VixCloudExtractor(BaseExtractor): async def version(self, domain: str) -> str: """Get version of VixCloud Parent Site.""" - DOMAIN = domain - base_url = f"https://streamingcommunity.{DOMAIN}/richiedi-un-titolo" + base_url = f"https://streamingcommunity.{domain}/richiedi-un-titolo" response = await self._make_request( base_url, headers={ - "Referer": f"https://streamingcommunity.{DOMAIN}/", - "Origin": f"https://streamingcommunity.{DOMAIN}", + "Referer": f"https://streamingcommunity.{domain}/", + "Origin": f"https://streamingcommunity.{domain}", }, ) if response.status_code != 200: