Skip to content

Commit

Permalink
Add SpeedFiles hoster
Browse files Browse the repository at this point in the history
  • Loading branch information
Commandcracker committed Dec 6, 2024
1 parent 1ede825 commit 7099479
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ List of supported Anime sites

List of supported video hoster.

- [x] Streamtape
- [x] VEO
- [x] Vidoza
- [x] Doodstream
- [x] SpeedFiles
- [x] ~~Streamtape~~
- [ ] Filemoon
- [ ] Luluvdo
- [ ] Vidmoly

## Player

Expand Down
2 changes: 1 addition & 1 deletion src/gucken/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import warnings
warnings.filterwarnings('ignore', message='Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')

__version__ = "0.2.4"
__version__ = "0.2.5"
8 changes: 8 additions & 0 deletions src/gucken/hoster/_hosters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
from .streamtape import StreamtapeHoster
from .veo import VOEHoster
from .vidoza import VidozaHoster
from .filemoon import FilemoonHoster
from .luluvdo import LuluvdoHoster
from .speedfiles import SpeedFilesHoster
from .vidmoly import VidmolyHoster

hoster = TwoWayDict(
{
"DS": DoodstreamHoster,
"ST": StreamtapeHoster,
"VEO": VOEHoster,
"VZ": VidozaHoster,
"FM": FilemoonHoster,
"LU": LuluvdoHoster,
"SF": SpeedFilesHoster,
"VM": VidmolyHoster
}
)
12 changes: 12 additions & 0 deletions src/gucken/hoster/filemoon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from re import compile as re_compile

from ..networking import AsyncClient

from .common import DirectLink, Hoster

FILEMOON_PATTERN = re_compile("")

# TODO: WIP !!!
class FilemoonHoster(Hoster):
async def get_direct_link(self) -> DirectLink:
return DirectLink("WIP")
12 changes: 12 additions & 0 deletions src/gucken/hoster/luluvdo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from re import compile as re_compile

from ..networking import AsyncClient

from .common import DirectLink, Hoster

LULUVODO_PATTERN = re_compile("")

# TODO: WIP !!!
class LuluvdoHoster(Hoster):
async def get_direct_link(self) -> DirectLink:
return DirectLink("WIP")
30 changes: 30 additions & 0 deletions src/gucken/hoster/speedfiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from re import compile as re_compile
from base64 import b64decode

from ..networking import AsyncClient

from .common import DirectLink, Hoster

SPEEDFILES_PATTERN = re_compile("var _0x5opu234 = \"(?P<stuff>.*?)\";")

class SpeedFilesHoster(Hoster):
async def get_direct_link(self) -> DirectLink:
async with AsyncClient(verify=False) as client:
response = await client.get(self.url)
match = SPEEDFILES_PATTERN.search(response.text)
stuff = match.group("stuff")
stuff = b64decode(stuff).decode()
stuff = stuff.swapcase()
stuff = ''.join(reversed(stuff))
stuff = b64decode(stuff).decode()
stuff = ''.join(reversed(stuff))
stuff2 = ""
for i in range(0, len(stuff), 2):
stuff2 += chr(int(stuff[i:i + 2], 16))
stuff3 = ""
for char in stuff2:
stuff3 += chr(ord(char) - 3)
stuff3 = stuff3.swapcase()
stuff3 = ''.join(reversed(stuff3))
stuff3 = b64decode(stuff3).decode()
return DirectLink(stuff3)
12 changes: 12 additions & 0 deletions src/gucken/hoster/vidmoly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from re import compile as re_compile

from ..networking import AsyncClient

from .common import DirectLink, Hoster

VIDMOLY_PATTERN = re_compile("")

# TODO: WIP !!!
class VidmolyHoster(Hoster):
async def get_direct_link(self) -> DirectLink:
return DirectLink("WIP")
20 changes: 20 additions & 0 deletions src/gucken/provider/aniworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from ..hoster.streamtape import StreamtapeHoster
from ..hoster.veo import VOEHoster
from ..hoster.vidoza import VidozaHoster
from ..hoster.filemoon import FilemoonHoster
from ..hoster.luluvdo import LuluvdoHoster
from ..hoster.speedfiles import SpeedFilesHoster
from ..hoster.vidmoly import VidmolyHoster
from .common import Episode, Hoster, Language, Provider, SearchResult, Series
from ..utils import json_loads

Expand All @@ -23,6 +27,14 @@ def provider_to_hoster(provider: str, url: str) -> Hoster:
return VidozaHoster(url)
if provider == "Streamtape":
return StreamtapeHoster(url)
if provider == "SpeedFiles":
return SpeedFilesHoster(url)
if provider == "Filemoon":
return FilemoonHoster(url)
if provider == "Luluvdo":
return LuluvdoHoster(url)
if provider == "Vidmoly":
return VidmolyHoster(url)


def lang_img_src_lang_name_to_lang(name: str) -> Language:
Expand Down Expand Up @@ -276,6 +288,14 @@ async def get_episodes_from_soup(
hoster.add(VidozaHoster)
if t == "Streamtape":
hoster.add(StreamtapeHoster)
if t == "SpeedFiles":
hoster.add(SpeedFilesHoster)
if t == "Filemoon":
hoster.add(FilemoonHoster)
if t == "Luluvdo":
hoster.add(LuluvdoHoster)
if t == "Vidmoly":
hoster.add(VidmolyHoster)

e_count += 1
title_en = title.find("span").text.strip()
Expand Down
20 changes: 20 additions & 0 deletions src/gucken/provider/serienstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from ..hoster.streamtape import StreamtapeHoster
from ..hoster.veo import VOEHoster
from ..hoster.vidoza import VidozaHoster
from ..hoster.filemoon import FilemoonHoster
from ..hoster.luluvdo import LuluvdoHoster
from ..hoster.speedfiles import SpeedFilesHoster
from ..hoster.vidmoly import VidmolyHoster
from .common import Episode, Hoster, Language, Provider, SearchResult, Series
from ..utils import json_loads

Expand All @@ -32,6 +36,14 @@ def provider_to_hoster(provider: str, url: str) -> Hoster:
return VidozaHoster(url)
if provider == "Streamtape":
return StreamtapeHoster(url)
if provider == "SpeedFiles":
return SpeedFilesHoster(url)
if provider == "Filemoon":
return FilemoonHoster(url)
if provider == "Luluvdo":
return LuluvdoHoster(url)
if provider == "Vidmoly":
return VidmolyHoster(url)


def lang_img_src_lang_name_to_lang(name: str) -> Language:
Expand Down Expand Up @@ -286,6 +298,14 @@ async def get_episodes_from_soup(
hoster.add(VidozaHoster)
if t == "Streamtape":
hoster.add(StreamtapeHoster)
if t == "SpeedFiles":
hoster.add(SpeedFilesHoster)
if t == "Filemoon":
hoster.add(FilemoonHoster)
if t == "Luluvdo":
hoster.add(LuluvdoHoster)
if t == "Vidmoly":
hoster.add(VidmolyHoster)

e_count += 1
title_en = title.find("span").text.strip()
Expand Down
8 changes: 6 additions & 2 deletions src/gucken/resources/default_settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ language = [
"JP_ENSUB"
]
hoster = [
"ST",
"VEO",
"VZ",
"DS"
"DS",
"SF",
"FM",
"LU",
"VM",
"ST"
]
update_checker = true

Expand Down

0 comments on commit 7099479

Please sign in to comment.