I am uploading videos with Python Youtube API v3. Below is my function which I use for it:
def YTUpload(file, title, description, keywords, category, privacyStatus): command = ['python','upload_video.py', f'--file="{file}"', f'--title="{title}"', f'--description="{description}"', f'--keywords="{keywords}"', f'--category="{category}"', f'--privacyStatus="{privacyStatus}"','--noauth_local_webserver' ] subprocess.run(''.join(command), shell=True)
I call this function like this:
if render_spedup: video = "Output/Video.mp4" title = "Title" keywords = "keywords" description = f"Line 1\nLine 2" try: YTUpload(video, title, description, keywords, category, privacyStatus) except Exception as err: print(err)
The problem is that only "Line 1" will actually be in the video description. I think that \n
breaks the whole command because it separates it in two, but how to deal with it?
I am expecting to get multi-line description below my Youtube video.