pytubefix
Pytubefix 8.3.2 Released
pip install pytubefix
pytubefix에서 YouTube 가져오기from pytubefix.cli 가져오기 on_progress url = "URL" yt = YouTube(url, on_progress_callback = on_progress)인쇄(yt.title) ys = yt.streams.get_highest_solution()ys.download()
pytubefix에서 YouTube 가져오기from pytubefix.cli 가져오기 on_progress url = "URL" yt = YouTube(url, on_progress_callback = on_progress)인쇄(yt.title) ys = yt.streams.get_audio_only()ys.download(mp3=True)
pytubefix에서 재생 목록 가져오기 pytubefix.cli에서 가져오기 on_progress url = "url"pl = pl.videos:ys = video.streams.get_audio_only()ys.download(mp3=True)의 비디오 재생 목록(url)
pytubefix에서 YouTube 가져오기from pytubefix.cli 가져오기 on_progress url = "url"yt = YouTube(url, use_oauth=True,allow_oauth_cache=True, on_progress_callback = on_progress) ys = yt.streams.get_highest_solution()ys.download() # 다운로드한 후에만 인증 요청을 받게 됩니다.
pytubefix에서 YouTube 가져오기from pytubefix.cli 가져오기 on_progressurl = "url"yt = YouTube(url, on_progress_callback = on_progress)ys = yt.streams.get_highest_solution()ys.download(output_path="path/to/directory")
pytubefix import YouTubeyt = YouTube('http://youtube.com/watch?v=2lAe1cqCOXo')subtitles = yt.captionsprint(자막)
pytubefix에서 YouTube 가져오기 yt = YouTube('http://youtube.com/watch?v=2lAe1cqCOXo')caption = yt.captions['a.en']print(caption.generate_srt_captions())
pytubefix에서 YouTube 가져오기 yt = YouTube('http://youtube.com/watch?v=2lAe1cqCOXo')caption = yt.captions['a.en']caption.save_captions("captions.txt")
from pytubefix import Channelc = 채널("https://www.youtube.com/@ProgrammingKnowledge/featured")print(f'채널 이름: {c.channel_name}')
from pytubefix import Channelc = 채널("https://www.youtube.com/@ProgrammingKnowledge")print(f'Downloading videos by: {c.channel_name}')c.videos:download = video.streams의 비디오용. get_highest_solution().다운로드()
>>> from pytubefix import Search>>> >>> results = Search('Github Issue Best Practices')>>> >>> results.videos의 비디오: ... print(f'제목: {video.title}') ... print(f'URL: {video.watch_url}') ... print(f'기간: {video.length}초') ... 인쇄('---') ... 제목: GitHub 문제의 모범 사례URL: https://youtube.com/watch?v=v1AeHaopAYEDuration: 406초---제목: GitHub 문제 팁 및 지침URL: https://youtube.com/watch?v=kezinXSoV5ADuration: 852 sec---제목: 13 고급(그러나 유용한) Git 기술 및 바로가기URL: https://youtube.com/watch?v=ecK3EnyGD8o기간: 486초---제목: GitHub 조직 도구, 팁 및 모범 사례 관리 - Mark MatyasURL: https://youtube.com/watch?v=1T4HAPBFbb0기간: 1525초---제목: GitHub 문제를 관리하는 가장 좋은 방법을 알고 계십니까?URL: https://youtube.com/watch?v=OccRyzAS4Vc지속시간: 534초--->>>
>>> pytubefix.contrib.search에서 가져오기 검색, 필터>>> >>> >>> f = { ... 'upload_data': Filter.get_upload_data('오늘'), ... '유형': Filter.get_type("비디오"), ... '기간': Filter.get_duration("4분 미만"), ... '기능': [Filter.get_features("4K"), Filter.get_features("크리에이티브 커먼즈")], ... 'sort_by': Filter.get_sort_by("업로드 날짜") ... }>>> >>> s = s.videos에서 c에 대한 검색('음악', 필터=f)>>>: ... 인쇄(c.watch_url) ... https://youtube.com/watch?v=_Rq8MzYz0YUhttps://youtube.com/watch?v=YHPGM8nBk3Uhttps://youtube.com/watch?v=m98WShs7MLEhttps://youtube.com/watch?v=-vBqfC3Nir0https ://youtube.com/watch?v=LbtrnCjopwk https://youtube.com/watch?v=pfl2ga6AS3chttps://youtube.com/watch?v=TzNk2ygEU4chttps://youtube.com/watch?v=yQfXVRKvA70https://youtube.com/watch?v=G5tQX990XU0https: //youtube.com/watch?v=4LQzYMhtXV8h ttps://youtube.com/watch?v=BOLGwdjCSAohttps://youtube.com/watch?v=CgSH3Ww3MHshttps://youtube.com/watch?v=_43tx98VEWchttps://youtube.com/watch?v=wLDRGZaBEoQhttps: //youtube.com/watch?v=3qaHb2t3Lkwht tps://youtube.com/watch?v=56deLmbicLghttps://youtube.com/watch?v=pQk2TzmwnS0https://youtube.com/watch?v=NJ3sOlg8KGohttps://youtube.com/watch?v=kfDSHjlk4Pghttps: //youtube.com/watch?v=8KHak4ZNO3k>>>