Using Pixeldrain for streaming
Amrayu78
I'd like to explore Pixeldrain for the stream links tab option on the site.
A few things to consider:
- Is there support on Pixeldrain (or any other service) that allows the subtitles and video to be hosted as-is? Kind of like how Youtube where you can turn the subtitles off and on.
- The easiest option is to hardsub (burn in the subtitles with the video and rehost the files, but this takes time and resources to accomplish)
- We'll need embeddable links from Pixeldrain (or other service) to embed on the site; users have more of an appetite to stream content these days.
- Count the streamed files against a user's usage on the site.
Amrayu78
Max Romanchenko Enhancement for streaming option.
Max Romanchenko
Amrayu78 Pixeldrain itself doesn’t provide this functionality directly, but I think it’s possible with a player that supports separate subtitle files alongside the video. From what I've found, most web players expect subtitles in the WebVTT format, it looks like conversion from .srt or .ass to .vtt is straightforward. That way the player can simply load the subtitles and let users turn them on or off while streaming. I'll run some tests to see how it works in practice.
Could you send me a sample link with subtitles, so I can test this approach?
Does that sound right?
Amrayu78
Max Romanchenko Yup, I think you understood correctly. I want to embed the videos with a video player directly on the site.
More users are on mobile and they do not have the luxury of downloading the actual files.
I've uploaded a sample file for you in the test folder that I created on gofile for you for the other task. Thanks.
Max Romanchenko
Amrayu78 Thank you for the video and subtitles. I've implemented video from Gofile/Pixeldrain with subtitle support (.ass and .srt are converted to .vtt on the fly) by connecting one of the popular VideoJS players. The player also handles our user download limits. I updated the message to say "You have reached your daily streaming limit {GB}."
The rest of the stream links remain unchanged. So it’s enough to provide a link to the folder containing the video and subtitles (Gofile or Pixeldrain filesystem), just like with the Pirates Booty links.
This works both on the Project page and on the related Title page.
Please check it out.
Amrayu78
Max Romanchenko Thanks for this! OMG, this is major. Thank you. I will test it out.
Can we add a warning at the top of the Stream Links tab and show it to everyone that isn't a contributor/admin/editor?
Pressing play on the video player will count towards your daily limit. (Is this a true statement)?
Amrayu78
Max Romanchenko Sorry I didn't bring this up earlier, but there's one concern I have.
Currently we have subtitles uploaded to the site which contain a hash on the file. Is it possible to add a hidden hash to the VTT files for whoever is logged in? My concern is users trying to exploit the stream link to download the subtitles to reshare without proper permission. I think it's critical to keep the hash intact if possible? Let me know if this is feasible with the current player.
Amrayu78
Max Romanchenko Any updates on my questions above? Thanks.
Max Romanchenko
Amrayu78 Sorry for the delayed response. I've added a warning for all users (except contributor/admin/editor). It's placed directly above the video, since not all stream links will be displayed as an embedded player. I hope this makes sense. Please check the screenshot.
- Pressing play on the video player will count towards your daily limit.
- Yes, that's true.
______
Regarding hash.
Current conversion to the VTT files removes comments/metadata, so I
I improved hash preservation when converting to the VTT format. The original hash is now retained, and streaming data is appended to it (indicating which user watched what and when).
Additionally, I added support for this streamin VTT files to our internal tool Tampered File Analysis, just in case.
_____________
I found a bug specific to Mozilla Firefox - instead of loading video in chunks, it tries to download the entire file at once. This causes playback to start only after the full video is loaded.
Other browsers handle chunked loading correctly. Firefox may be expecting a special header flag from Gofile/Pixeldrain, even though the servers already return a standard 206 response (partial load). For now, there's no proper fix.
This issue may be related to the MKV format - other formats might behave differently in Firefox. In any case, a chromium based browser is preferable for video playback.
Another bug - Safari on iPhone does not support MKV files...
Amrayu78
Max Romanchenko Will the warning about daily limit, appear for external links? If yes, we can update the warning to this...
Pressing play on the video player will count towards your daily limit.
External stream links do not count towards your daily limit.
Use a chromium-based browser for the best experience.
I will check the hash, thanks for implementing this!
Thanks for checking the bugs as well.
For iPhone, users can download a Chrome browser and that'll work right? I guess I can check this as well.
Amrayu78
Max Romanchenko I'm testing an mkv file and the video doesn't play audio. I'll list the steps.
- Mirrored file from gofile to pixeldrain
- Created a folder within the directory
- Moved first episode to the folder
- Uploaded the first episode's subtitles (.ass) to the folder
- Embedded the folder link
- No audio
- No subtitles appear
You can check the link here: https://drama-otaku.com/subtitle-project/ryakudatsu-datsukon/#stream-links
Max Romanchenko
Amrayu78 The warning only appears above external links to gofile.io or pixeldrain.com.
So I think we can remove the line "External stream links do not count towards your daily limit."
It would then read:
"Pressing play on the video player will count towards your daily limit.
Use a chromium-based browser for the best experience."
This shows only above the embedded video on the site.
Please check the screenshot - ok?
Max Romanchenko
Amrayu78 I checked your case and there are two separate issues:
- Subfolders
Right now the script doesn't support links to subfolders like
https://pixeldrain.com/d/xxxxxxxx/E01.
That's why the player is actually loading the file from the parent folder (https://pixeldrain.com/d/xxxxxxxx).
I need to check if Pixeldrain API supports subfolder codes, since I don't see them in the response.
As a temporary fix, please copy the files from E01 back into the parent folder, then subtitles should appear correctly.
___
- Audio
I checked the file info using MediaInfo (although this is also available in other tools, such as VLC player).
https://mediaarea.net/en/MediaInfo
The file "Bakebake E083-NHK1-WEB-DL-1080p-H264-AAC-DramaClub.mkv" (from my test folder) plays audio because it uses AAC, which browsers support.
The file "Ryakudatsu Datsukon S01E02 1080p AMZN WEB-DL DDP2.0 H.264-NSBC.mkv@]" has audio in Dolby Digital Plus (EAC3), which browsers don't support, so Video.js can't play it. To make it work, the audio needs to be converted to AAC.
In short - subtitles are missing because of the subfolder link, and audio is missing because of the codec.
I'll try converting the audio myself and let you know if this confirms the issue.
Amrayu78
Max Romanchenko This is fine. Thanks.
Amrayu78
Max Romanchenko How does the stream link feature handle a directory with multiple video files?
Amrayu78
Max Romanchenko No need to convert the audio. There's another version of this same drama that I just mirrored to Pixeldrain.
https://drama-otaku.com/subtitle-project/ryakudatsu-datsukon/#stream-links
I just checked and the audio is working nicely.
Max Romanchenko
Amrayu78 Great to hear it's working now, thanks for confirming!
Right now the stream link feature only handles the first video file in a directory. I still need to test whether we can support multiple files, either by showing several players or by building a playlist. For now it's limited to one file, but I'll explore options and let you know what's possible. How would you prefer it to work with multiple files?
Amrayu78
Max Romanchenko I'm fine with either way. Having multiple players might clutter up the screen?
Or we can have it so there's tabs that shows different video players of the different episodes that look like a playlist?
I'm open to anything that doesn't look too cluttered.
As long as the subtitles contain the hash + the daily limits are intact, I'm fine with almost anything. Thanks.
Max Romanchenko
Amrayu78 Thank you! I agree with you, keeping it clean and not cluttered is important. I'll look into the options and try to find the best solution.
Max Romanchenko
Amrayu78 I've added support for multiple videos in a folder. The script now tries to create the same number of tabs as there are videos, and it also assigns tab titles based on the file names (e.g., Ep.1, Ep.2). Please check and let me know if it works as expected.
Amrayu78
Max Romanchenko just checked this and it’s awesome! Thanks for doing this.
Okay I think we are almost done. One final question…
I prefer to host in one spot, and not have to double host just to save on costs. Of course in some instances double hosting is necessary. Currently I’m uploading files mainly to gofile for the pirates booty. Sometimes there’s subtitles there too. In the download popup, can we add hashes to those subtitle files as well? We have hashes for subtitles that are directly uploaded to a subtitle project but I’m not sure if it’s added to the download popup. This will close the loop on this.
Max Romanchenko
Amrayu78 Glad to help, happy it's working well! At the moment, hashes are not added to subtitle files when they're downloaded from Gofile or Pixeldrain. I'll work on updating the popup so that subtitle downloads include the hash as well.
Amrayu78
Max Romanchenko For the tabs, can we name them to Ep 1, Ep 2 (remove the period), so it's consistent with the home page (we have Ep 1 etc) there.
One more thing, is it possible to log the clicks? I'd like to keep a log of views per episode. Is this possible? Eventually, I'd like to add these stream link data on the front page and the grog log.
Max Romanchenko
Amrayu78 I've updated the tab names and they now show as Ep 1, Ep 2 (without the period) to match the home page style.
Regarding logging, I just want to clarify what exactly you'd like to track. At the moment, we already log video plays in the same table we use for user limits, similar to how downloads from Gofile or Pixeldrain are tracked. From a logic standpoint, watching a video is treated the same as downloading a file, so all of these interactions are already being logged under the hood.
That means if Ep 1 is played more often than Ep 2, the log data will naturally show Ep 1 as the more popular file. Could you let me know what kind of widget or data you'd like to see on the front page? For example, we could query the most popular files and display a "top files" list for a given period. Note that we already have the "Most Downloaded" widget on the front page, which works differently and shows projects with the highest number of related attachment downloads.
For the grog log (stats) page, the data is stored in the post itself and reset every week. To integrate the stream link data with that page, I'll need more details, for example, should we be parsing subtitle projects (since they hold the stream link to the video), or something else?
Sorry for the extra questions, I just want to get everything right. Maybe a mockup of the front page would help me a lot. Thank you!
Amrayu78
Max Romanchenko Thanks!
There's one use case related to episode numbers. Sometimes there's 6.5 or 10.5 etc. I've attached what a use case like this looks like. https://drama-otaku.com/subtitle-project/escape-it-was-supposed-to-be-a-kidnapping/#stream-links
Are we able to get the 6.5, 10.5 to show up in the tabs? Currently it shows 7s doubled, 10s doubled, etc.
Logging, it's great that this is all tracked already, but I think I may be getting ahead of myself. As long as the tracking is there and we can query the data, that's good for now.
I'm attaching what I foresee the frontpage widget to look like. Please do not implement it on the frontpage yet, since I've not announced this new streaming feature yet. I'd like to get some titles linked and streamable first, so maybe we can work on this after a month or two?
For the grog log, I think we should be parsing the Subtitle Projects to see how many streams have been viewed?
Max Romanchenko
Amrayu78 I've added support for episode numbers like 6.5 or 10.5, so they should now show up correctly in the tabs. Please check it.
Thanks a lot for the details, this really clarified the situation. The only thing missing right now is saving a global and weekly counter of video views for each Subtitle Project, so that later we can implement the frontpage widget and have it work properly with the statistics page. I'll work on adding this so the data is collected in advance, and then we can focus on the frontpage widget a bit later once everything is ready.
_______
Yes, we definitely need to settle on some kind of naming standard so that parsing works consistently. I've added a few more variations to handle episode extraction correctly. I double checked and it looks like you were able to rename the files so it’s working fine now?
https://drama-otaku.com/subtitle-project/soko-kara-saki-wa-jigoku/
Over time, as we keep using this, I think we'll be able to cover more naming scenarios and make it as robust as possible.
Amrayu78
Max Romanchenko Thanks for the fix. I see the decimal numbers showing correctly now.
For Soko Kara title, I realized that the code was pulling from the hash contained in the file name, so I just renamed everything to E01 format to make it consistent. That seemed to work. Thanks!
Amrayu78
Max Romanchenko One thing though... is it possible to add reordering to the stream links? I noticed that I couldn't reorder anything.
Amrayu78
Max Romanchenko Also I'm not sure what's wrong with the stream links for this title: https://drama-otaku.com/subtitle-project/soko-kara-saki-wa-jigoku/
After trying to process them and renaming, they don't ever load in the player.
Amrayu78
Max Romanchenko Some more tweaks!
Max Romanchenko
Amrayu78
- I’ve added the control for ordering stream links, please check it.
- - Also, I’m not sure what’s wrong with the stream links for this title: https://drama-otaku.com/subtitle-project/soko-kara-saki-wa-jigoku/
- If you check the sharing link on Gofile, the video also doesn't play there and can only be downloaded. In the Network tab it shows:
Soko%20Kara%20E02%20(eng%20subs).mp4 (canceled) media Other 0.0 kB 32 ms
This same error appears on the Gofile sharing page when clicking Play.
It's possible the files were somehow corrupted in Gofile's system or the video format doesn't support streaming. Could you try reuploading the file to see what the issue is?
- I've added logging for the statistics page (total video streams and weekly video streams per Subtitle Project). This will allow us to build a frontpage widget in the future (the data collection is already working).
- Some more tweaks!
Regarding the tweaks, you mentioned Eyeball icon - XXX views.
By "views" do you mean total plays through the embedded video players, or visits to the Project page itself?
Amrayu78
Max Romanchenko
- Ordering: Can we add drag and drop re-ordering like we have for other features? I've moved one link to the top, but had to click the up arrow like 12 times to get it to the top.
- I'll check what's wrong, but usually gofile has that error (I think). Will try to reupload.
- Thanks!
- Let's change it to XXX plays. (so its not confused with page views). The page itself already has a page view counter, so I'm referring to number of times the video was clicked/played.
Max Romanchenko
Amrayu78
- I've implemented drag and drop reordering, please check it.
- Thank you!
- You're welcome!
- Thanks for clarifying, I agree and I'm working on this.
- Regarding the download popup and subtitle file hashes. I implemented it so that the file is first downloaded to our server and then delivered to the user with a unique hash. This applies only to subtitle files - videos themselves are downloaded directly from API, so it doesn't create any additional load on our server. I double checked and it's already working everywhere (Drama Otaku subtitles, video subtitles (vtt), and subtitles from Gofile/Pixeldrain).
Also, the Tampered File Analysis tool has been improved and moved to Tools:
https://drama-otaku.com/wp-admin/tools.php?page=tampered-file-analysis