I am currently writing an application that involves the uploading of videos to Youtube using the Youtube Data API v3 with Python. This has been working until recently, in which I am suddenly receiving a strange error.
I use the following code to upload videos:
from subprocess import runcommand = f'python3 uploadYoutube.py --file="{video_name}" --title="{title}" --description="{vid_des}" --keywords={keywords}" --category="{category}" --privacyStatus="public"'terminal_output = run(command, capture_output=True).stdoutprint(terminal_output)
Where the variables inside the f-string are neither empty nor contain the characters <
or >
.
This provides the following error:
An HTTP error 400 occurred:\r\nb\'{\\n "error": {\\n "code": 400,\\n "message": "The request metadata specifies an invalid or empty video title.",\\n "errors": [\\n {\\n "message": "The request metadata specifies an invalid or empty video title.",\\n "domain": "youtube.video",\\n "reason": "invalidTitle",\\n "location": "body.snippet.title",\\n "locationType": "other"\\n }\\n ]\\n }\\n}\\n\'\r\n'
What is the reason for this error?