I am trying to youtube videos to merge with audio(formate_id:140) and video(formate_id:313) using the youtube-dl library. But it downloads files in the local system. I want it directly download to the client side. I don't want to store files in the local system.
Client-side means downloading files directly to a user system through a browser.
Local system means it's my server.
Example
ydl_opts = {
'format': '313+140',
'keepvideo':'false',
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=Wt8VRxUYDso'])
If any way like merging process and response streaming process work at a time.
r = requests.get(videoUrl, stream=True)
response = StreamingHttpResponse(streaming_content=r)
response['Content-Disposition'] = f'attachement; filename="{fileName}"'
return response
Please guide me in solving this coding problem.