Save_bili.py 640 B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. # @Author : ChenZhaoyuchen
  3. # @Time : 2024/9/13 15:02
  4. # @File : Save_bili.py
  5. from setting import Audio_path,Audio_format,Video_format,Video_path
  6. from GetResponse import GetResponse_video,GetResponse_audio
  7. def Savevideo(title,video_url):
  8. video_content = GetResponse_video(url = video_url).content
  9. with open(Video_path + title + Video_format, mode='wb') as video:
  10. video.write(video_content)
  11. def Saveaudio(title,audio_url):
  12. audio_content = GetResponse_audio(url = audio_url).content
  13. with open(Audio_path + title + Audio_format, mode='wb') as audio:
  14. audio.write(audio_content)