Okay, so I've got this small problem with a bash script that I'm writing.

This script is supposed to be run like this:

bash script.sh https://www.youtube.com/user/<channel name>

OR

bash script.sh https://www.youtube.com/user/<random characters that make up a youtube channel ID>

It downloads an entire YouTube channel to a folder named

<uploader>{<uploader_id>}/

Or, at least it SHOULD...

the problem I'm getting is that the archive.txt file that youtube-dl creates is not created in the same directory as the videos. It's created in the directory from which the script is run.

Is there a grep or sed command that I could use to get the archive.txt file to the video folder?

Or maybe create the folder FIRST, then cd into it, and run the command from there? I dunno

Here is my script: