New S.to
It looks like s.to has released a new version with an updated layout. Could you please update your repository to support the changes?
Hello, thanks for the notice. I’ve just finished the changes to support the new layout.
Currently only s.to uses the new page layout though. So if anyone needs support for AniWorld.to, please do not update yet. I suspect AniWorld.to will adopt the new layout soon, so legacy support will remain on hold for now.
Hi there,
I'm using a very customized version of your code, but the problem should still exist.
After the new update for s.to, the new layout uses urls like that:
- "https://s.to/serie/fallout/staffel-1/episode-1"
But your updated code still uses kind of these lines:
HtmlNode root = await GetHtmlRootAsync($"{site}/stream/{title.ToRelativePath()}/staffel-{season}/episode-{number}", cancellationToken);
The difference is the "/stream" subfolder.
After removing the "/stream" subfolder from the code, it works fine.
Hi there,
I'm using a very customized version of your code, but the problem should still exist.
After the new update for s.to, the new layout uses urls like that:
* "https://s.to/serie/fallout/staffel-1/episode-1"But your updated code still uses kind of these lines:
HtmlNode root = await GetHtmlRootAsync($"{site}/stream/{title.ToRelativePath()}/staffel-{season}/episode-{number}", cancellationToken);The difference is the "/stream" subfolder.
After removing the "/stream" subfolder from the code, it works fine.
Did you manage to download anything correctly? I also removed the "/stream" but ffmpeg only downloads the first 9 to 12 minutes of the video. I suspect the change also caused this, thus I think it's relevant here. Do you get more than a few minutes?
Hi there,
I'm using a very customized version of your code, but the problem should still exist.
After the new update for s.to, the new layout uses urls like that:
- "https://s.to/serie/fallout/staffel-1/episode-1"
But your updated code still uses kind of these lines:
HtmlNode root = await GetHtmlRootAsync($"{site}/stream/{title.ToRelativePath()}/staffel-{season}/episode-{number}", cancellationToken);The difference is the "/stream" subfolder.
After removing the "/stream" subfolder from the code, it works fine.
@miku86 Hi there, thanks for letting me know. You're right: they updated the URL paths and removed the "/stream" part. I missed that because they are automatically rerouting all the old paths to the new ones, I guess to not break saved bookmarks and such. So for now everything should be working fine, the included Unit Tests also all pass. But I should probably update that sometime in the future, thanks!
Did you manage to download anything correctly? I also removed the "/stream" but ffmpeg only downloads the first 9 to 12 minutes of the video. I suspect the change also caused this, thus I think it's relevant here. Do you get more than a few minutes?
@kolgie Hi, downloading is not handled by SerienStream but by the specific providers, so the update is most definitely not the cause. It could be that a provider updated their site though, which one are you using to extract the stream URL? I have just tested using VOE and it worked just fine to download a full 25 min episode. Could you send me your URL or tell me which series/season/episode you are trying to download?
Hi there, I'm using a very customized version of your code, but the problem should still exist. After the new update for s.to, the new layout uses urls like that:
- "https://s.to/serie/fallout/staffel-1/episode-1"
But your updated code still uses kind of these lines:
HtmlNode root = await GetHtmlRootAsync($"{site}/stream/{title.ToRelativePath()}/staffel-{season}/episode-{number}", cancellationToken);The difference is the "/stream" subfolder. After removing the "/stream" subfolder from the code, it works fine.@miku86 Hi there, thanks for letting me know. You're right: they updated the URL paths and removed the "/stream" part. I missed that because they are automatically rerouting all the old paths to the new ones, I guess to not break saved bookmarks and such. So for now everything should be working fine, the included Unit Tests also all pass. But I should probably update that sometime in the future, thanks!
Did you manage to download anything correctly? I also removed the "/stream" but ffmpeg only downloads the first 9 to 12 minutes of the video. I suspect the change also caused this, thus I think it's relevant here. Do you get more than a few minutes?
@kolgie Hi, downloading is not handled by SerienStream but by the specific providers, so the update is most definitely not the cause. It could be that a provider updated their site though, which one are you using to extract the stream URL? I have just tested using VOE and it worked just fine to download a full 25 min episode. Could you send me your URL or tell me which series/season/episode you are trying to download?
Hey, thanks for the reply. For testing purposes I'm using the first episode of the first season of The Rookie (as seen in my code). Excuse me if I didn't fully understand your code, I'm very new to C#. I couldn't get the logging to work so I replaced it with Console.WriteLine (which doesn't really work with the progress updates at the bottom). The variables in the strings also didn't work so I used $ strings. It only downloads a few minutes every time. I'm also using a VPN if that's relevant. Here is my code:
using SerienStreamAPI.Enums;
using SerienStreamAPI.Exceptions;
using SerienStreamAPI.Internal;
using SerienStreamAPI.Models;
using SerienStreamAPI.Client;
class Program
{
static async Task Main(string[] args)
{
string showTitle = "The Rookie";
// Create a new SerienStreamClient
SerienStreamClient client = new(hostUrl: "https://s.to/", site: "serie", ignoreCertificiateValidation: false, logger: null);
// Create a new DownloadClient
DownloadClient downloadClient = new(ffmpegLocation: "ffmpeg.exe", ignoreCerficiateValidation: false, logger: null);
// Search for a series via the title
Series series = await client.GetSeriesAsync(showTitle);
Console.WriteLine($"Title: {series.Title}, Description: {series.Description}");
// Get all episodes of a season
Media[] episodesOfSeason1 = await client.GetEpisodesAsync(showTitle, 1);
foreach (Media episode in episodesOfSeason1)
Console.WriteLine($"[{episode.Number}] Title: {episode.Title}");
// Get video details
VideoDetails episodeVideoDetails = await client.GetEpisodeVideoInfoAsync(showTitle, 1, 1);
foreach (VideoStream videoStream in episodeVideoDetails.Streams)
Console.WriteLine($"Video Stream [{videoStream.VideoUrl}]: {videoStream.Hoster}-{videoStream.Language.Audio}-{videoStream.Language.Subtitle}");
// Get the video details of the first episode of the first season of the series "My Dress-Up Darling"
VideoDetails videoDetails = await client.GetEpisodeVideoInfoAsync(series.Title, 1, 1);
// Select the first German-audio video stream
VideoStream videoStreamAlt = videoDetails.Streams.FirstOrDefault(stream => stream.Language.Audio == Language.German) ?? throw new Exception("No German video stream found!");
// Extract hoster stream url from video stream
string streamUrl = videoStreamAlt.Hoster switch
{
Hoster.VOE => await downloadClient.GetVoeStreamUrlAsync(videoStreamAlt.VideoUrl),
Hoster.Streamtape => await downloadClient.GetStreamtapeStreamUrlAsync(videoStreamAlt.VideoUrl),
Hoster.Doodstream => await downloadClient.GetDoodstreamStreamUrlAsync(videoStreamAlt.VideoUrl),
Hoster.Vidoza => await downloadClient.GetVidozaStreamUrlAsync(videoStreamAlt.VideoUrl),
_ => throw new Exception("Hoster is not supported!")
};
Console.WriteLine(streamUrl);
// Download video stream
await downloadClient.DownloadAsync(streamUrl, "video.mp4", null, new Progress<EncodingProgress>(progress =>
//logger.LogInformation("Downloading episode... Time: {timeElapsed}, Speed: {speed}x", progress.TimeElapsed, progress.SpeedMultiplier)));
Console.WriteLine($"Downloading episode... Time: {progress.TimeElapsed}, Speed: {progress.SpeedMultiplier}x")));
}
}
Thanks for the code! The progress logging doesn’t work because you’re probably using a newer FFmpeg version. I’ve already created an update that adds support for this. While doing that, I also noticed that the old URL paths are only re-routed when using the direct s.to domain (186.2.175.5); otherwise, you get the “Moved Permanently” error yall talked about. I included a fix for that as well.
Regarding the download issues: when I’m connected to a VPN, I also experience very, very slow speeds - about 0.5× (meaning it would take twice as long as the video’s length to download). I didn’t wait long enough to see whether it would fail at some point. After disconnecting from the VPN, the speeds improved significantly (around 20×), and I was able to download the full 41-minute episode in just a few minutes. It looks like the VOE bot protection doesn’t like VPNs a lot... I haven't tested other providers as s.to appearntly only uses VOE now?
Thanks for the code! The progress logging doesn’t work because you’re probably using a newer FFmpeg version. I’ve already created an update that adds support for this. While doing that, I also noticed that the old URL paths are only re-routed when using the direct s.to domain (186.2.175.5); otherwise, you get the “Moved Permanently” error yall talked about. I included a fix for that as well.
Regarding the download issues: when I’m connected to a VPN, I also experience very, very slow speeds - about 0.5× (meaning it would take twice as long as the video’s length to download). I didn’t wait long enough to see whether it would fail at some point. After disconnecting from the VPN, the speeds improved significantly (around 20×), and I was able to download the full 41-minute episode in just a few minutes. It looks like the VOE bot protection doesn’t like VPNs a lot... I haven't tested other providers as s.to appearntly only uses VOE now?
Thank you so much for testing. It seems I just chose a bad server. Changed it and (while being slow of course) it downloads full episodes now. I'm no specialist on licenses but it is okay if I fork this, right?
I'm glad everything works now! And of course you can fork the repo.