NHacker Next on Rails
  • top
  • new
  • best
  • ask
  • show
  • jobs
login
GuidelinesFAQListsAPISecurityLegalApply to YCContact

Hacker News on Rails, powered by React on Rails Pro. Open the source on GitHub by ShakaCode.

Commit 06fc0df

Rendered at 09:05:14 GMT+0000 (Coordinated Universal Time) with Rails + React on Rails RSC.

Best way to process a YouTube video/playlist on your website?

9 points by vivzkestrel 3d ago | 14 comments

praveendath92 12h ago
If you want audio or video data server side, nothing beats vidkraken.com on reliability. It worked even for niche content too - like geo-locked to Turkey, age-restricted.
vivzkestrel 6h ago
i want frames from the video for ocr
runjake 2d ago
Instead of grabbing the video, grab the transcript, if its available.

Edit: I see from OP's comment, they actually want to OCR frames for text. From personal experience at a much smaller scale than what you're talking about, YT will probably nix that. Use a disposable Google account as it will likely get permanently banned.

vivzkestrel 1d ago
- sorry i did not get it, what does this disposable google account actually do?
runjake 16h ago
Reworded:

This activity will probably get your Google account banned for violating their terms of use. Do not use an important Google account for this.

Good luck. I did something similar and had legitimate fun working on the project and learned a lot.

robertgeiger 1d ago
another way is to process it live while the user is viewing the video, so that it only occurs in the browser on the users computer. You just can't store any of the audio/video from the site, but you can process them live in the browser. I don't know if that will work for your web app, but it is what I did for my chrome extension which ran into the same issue. I needed to process the audio to be able to show pitch/tone of the speakers on youtube and i was able to do that effectively. Look for my chrome extension (speaktube) if you want to see it working, and i can give you more details on how i actually handled it on the code side if you want those details, just let me know.
vivzkestrel 1d ago
- let me take a look at speaktube and get back to you
forthechemicals 3d ago
HaaaHaaa! this is exactly the issue i'm facing. fun to see it as the first post on ask page. "obviously yt-dlp is against terms of service from what i know" ---> If you're scraping and keeping the data, no one's stopping you. having said that i also haven't done it. If you are building a context pipeline I feel keeping the transcript(which you know is high quality) and the url is enough unless you want to download the video itself. Lemme know what you choose to do. I am also working on this exact workload.
vivzkestrel 2d ago
- well my app is more complicated

- i need video frames to ocr

- maybe i can process video to frames and send frames over to server directly or aws s3 bucket directly with video id as folder

- not sure if there are better ways

forthechemicals 2d ago
Sounds interesting. downloading the video is the hassle. better send the video url to the server and do all heavy things there. What is your ocr workflow? I have a use case that i had built previously but it wasn't very accurate. I tried to build a pullup counter which would classify bad form also but then that was beyond just a hassle and i gave it up, but now i feel with these system one workflows maybe these problem shapes can be approached but i haven't tried them.
vivzkestrel 2d ago
- if i send the url to the server, my backend would need to download it inside a worker.

- this worker would have to use yt-dlp unless youtube api provides a way to download videos not belonging to your channel

- the worker's IP address ll definitely get flagged by youtube after a few short runs

- not to mention i have no idea what is the legality of doing this as a limited liability company

- the workflow for ocr is simple, once i have the frames from input video, i can add a task to the queue with s3 image links per video id and any model such as paddle ocr, chandra etc can quickly perform the image analysis and send my express server back the results

- the major bottleneck for me seems to be the process to get an mp4 out of youtube currently

forthechemicals 2d ago
i dont think youtube will let you download the mp4 cause why would they. I am thinking about the download option youtube provides. When you download a video its in your system now right so it must be somewhere. IndexDB perhaps idk but if that can be salvaged you could lean into youtube's own feature for your requirement but then i dont think every video is downloadable. This will also allow you to keep your download and frame processing workload in the client side and only stream frames.
526933 2d ago
youtube
vivzkestrel 1d ago
???