Skip to content

Commit

Permalink
adds SpeedFiles as provider (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
speedyconzales authored Dec 8, 2024
1 parent 0552d3e commit f22266e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ headless and completely automated scraping of the following sites:
- [Doodstream](https://doodstream.com)
- [Streamtape](https://streamtape.com)
- [Vidmoly](https://vidmoly.to)
- [SpeedFiles](https://speedfiles.net)

## Usage
* If you are familiar with docker
Expand Down Expand Up @@ -97,7 +98,7 @@ headless and completely automated scraping of the following sites:
| `-s, --season` | **Default:** All seasons will be scraped but not the movies or specials. Choose the season number. -> Providing `0` as season number scrapes the respective movies or specials of that series |
| `-e, --episode` | **Default:** All episodes of the season will be scraped. Choose either one episode or a list of episodes separated by spaces. You can also specify a range of episodes e.g.: `-e 2 3 10-15 17` |
| `-t, --threads` | **Default:** 2. Specify the number of threads or concurrent downloads. Do not choose too high numbers as the server might block too frequent requests |
| `-p, --provider` | **Default:** Downloads will follow this priority: Vidoza > VOE > Doodstream > Streamtape > Vidmoly. If the episode is not available on the hoster it will try the next. Specify the hoster/provider you want to download from |
| `-p, --provider` | **Default:** Downloads will follow this priority: Vidoza > VOE > Doodstream > Streamtape > Vidmoly > SpeedFiles. If the episode is not available on the hoster it will try the next. Specify the hoster/provider you want to download from |
| `-a, --anime` | Declare this content as anime. Only useful for `bs.to` as it does not distinguish between series and anime on the site |
## Credits
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main():

os.makedirs(output_path, exist_ok=True)

providers = ["Vidoza", "VOE", "Doodstream", "Streamtape", "Vidmoly"] if not provider else provider
providers = ["Vidoza", "VOE", "Doodstream", "Streamtape", "Vidmoly", "SpeedFiles"] if not provider else provider

for season in seasons:
season_path = f"{output_path}/Season {season:02}"
Expand Down
2 changes: 1 addition & 1 deletion src/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def parse_range(episodes):
parser.add_argument("-s", "--season", type=int, help="specify the season")
parser.add_argument("-e", "--episode", nargs='+', type=str, help="specify a list of episode numbers")
parser.add_argument("-t", "--threads", type=int, help="specify the number of threads or concurrent downloads")
parser.add_argument("-p", "--provider", choices=["VOE", "Vidoza", "Streamtape", "Doodstream", "Vidmoly"], help="Choose the hoster/provider you want to download from")
parser.add_argument("-p", "--provider", choices=["VOE", "Vidoza", "Streamtape", "Doodstream", "Vidmoly", "SpeedFiles"], help="Choose the hoster/provider you want to download from")
parser.add_argument("-a", "--anime", action='store_true', help="specify if the content is an anime")

args = parser.parse_args()
Expand Down
19 changes: 18 additions & 1 deletion src/html_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
re.compile(r'prompt\("Node",\s*"(?P<url>[^"]+)"')]
STREAMTAPE_PATTERN = re.compile(r"get_video\?id=[^&\'\s]+&expires=[^&\'\s]+&ip=[^&\'\s]+&token=[^&\'\s]+\'")
VIDMOLY_PATTERN = re.compile(r"sources: \[{file:\"(?P<url>.*?)\"}]")

SPEEDFILES_PATTERN = re.compile(r"var _0x5opu234 = \"(?P<content>.*?)\";")

def get_episode_link(url, language, provider, season, episode, burning_series):
if burning_series:
Expand Down Expand Up @@ -129,6 +129,23 @@ def find_content_url(url, provider):
print(content_link)
if content_link is None:
logger.error(f"Failed to find the video link of provider Vidmoly")
elif provider == "SpeedFiles":
match = SPEEDFILES_PATTERN.search(decoded_html)
content = match.group("content")
content = b64decode(content).decode()
content = content.swapcase()
content = ''.join(reversed(content))
content = b64decode(content).decode()
content = ''.join(reversed(content))
next_content = ""
for i in range(0, len(content), 2):
next_content += chr(int(content[i:i + 2], 16))
content_link = ""
for char in next_content:
content_link += chr(ord(char) - 3)
content_link = content_link.swapcase()
content_link = ''.join(reversed(content_link))
content_link = b64decode(content_link).decode()
logger.debug(f"Found the following video link of {provider}: {content_link}")
return content_link

Expand Down

0 comments on commit f22266e

Please sign in to comment.