我在Wordpress中使用了26个子主题。但是我遇到了25个错误...主要是意外的令牌错误,还有一些“预期的LBRACE”和“预期的IDENT”错误。我不知道这些是什么意思。任何帮助将不胜感激。
https://i.imgur.com/EwLrreI.jpg
https://i.imgur.com/jxwk300.jpg
https://i.imgur.com/9MUPHRu.jpg
from pytube import YouTube
import os
yt = YouTube(str(input("Enter the URL of the video you want to download: \n>> ")))
print("Select download format:")
print("1: Video file with audio (.mp4)")
print("2: Audio only (.mp3)")
media_type = input(">> ")
if media_type == "1":
video = yt.streams.first()
elif media_type == "2":
video = yt.streams.filter(only_audio = True).first()
else:
print("Invalid selection.")
print("Enter the destination (leave blank for current directory)")
destination = str(input(">> ")) or '.'
out_file = video.download(output_path = destination)
if media_type == "2":
base, ext = os.path.splitext(out_file)
new_file = base + '.mp3'
os.rename(out_file, new_file)
print(yt.title + " has been successfully downloaded.")