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

- i want to extract text from youtube videos on my webapp

- users submit a url for a video or a playlist and then the processing begins

- obviously yt-dlp is against terms of service from what i know

- how do I handle this?

- option 1: i could ask user to download the mp4 themselves externally for a video or a playlist and then ask them to upload (bad UX but good on the legal side)

- option 2: ask user to paste link to video or playlist, send it to express and run yt-dlp on it (good UX, bad legal side) + it ll need a lot of workarounds and maintenance to ensure your server IP isnt getting blocked all the time

- option 3: paste url to video and link on webapp, download videos client side to mp4 and then upload to signed s3 bucket which is taken by the server for processing (not sure about ux or legal here)

- any other options?

- what do you recommend?

5 points | by vivzkestrel 14 hours ago

9 comments

  • forthechemicals 9 hours 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 8 hours 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 3 hours 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 2 hours 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 1 hour 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.
  • subtitleparrot 3 hours ago
    [dead]
  • soloventure_hq 5 hours ago
    [dead]
  • jamesLOL 4 hours ago
    [dead]
  • jessemhoffer 3 hours ago
    [dead]
  • ivantang26 13 hours ago
    [dead]
  • qmplayveil 6 hours ago
    [dead]
  • anmolsethi_dev 13 hours ago
    [dead]
  • thecuriousbuild 12 hours ago
    [dead]