Advertisement
FanaticExplorer

webm_not_mp4

Oct 16th, 2021
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. from yt_dlp import YoutubeDL
  2. import os
  3.  
  4.  
  5.  
  6. class Downloader:
  7.     ydl_opts = {
  8.             'outtmpl':"%(title)s.mp4"
  9.     }
  10.     def __init__(self,download_link):
  11.         self.download_link=download_link
  12.  
  13.     def download_video(self):
  14.         with YoutubeDL(self.ydl_opts) as ydl:
  15.             result = ydl.extract_info("{}".format(self.download_link))
  16.             filename=ydl.prepare_filename(result)
  17.             return filename
  18.  
  19. downloader_from_the_link=Downloader('https://www.youtube.com/watch?v=SKvIyDB5FRU')
  20. print(downloader_from_the_link.download_video())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement