How do you change the download directory for youtube-dl - discord.py

I am using youtube-dl for a Discord Music Bot, everything works perfectly until I use the 'play' command. An error occurs "Command raised an exception: DownloadError: ERROR: unable to open for writing: [Errno 13] Permission denied: 'National Anthem of USSR-U06jlgpMtQs.webm.part'" from what I have read (and what the error says) it is because youtube-dl doesn't have permission to download filed to a certain folder. So I'd imagine that an easy solution is to just change the download directory. I can't find anything on how to do it for python, so any help would be greatly appreciated!
Thanks,

Found on github's documentation for it.
Locate youtube-dl's config file from:
Linux/macOS:
System-wide config : /etc/youtube-dl.conf
User-wide config : ~/.config/youtube-dl.conf
Windows:
C:\Users\<username>\youtube-dl.conf
%APPDATA%\youtube-dl\config.txt
If non-existent, you can create it yourself.
Example file contents:
-o A:/path/to/file/%(title)s.%(ext)s
References:
Flag to specify a file path.
Setting up config file.

Spent some time to figure out on Windows 10 and it might help someone in the future.
I've downloaded youtube-dl.exe from the latest build and downloaded by executing, youtube-dl.exe URL, from my home directory. The program says downloaded completed but *** it was not there so I issued the command again, and it says there already exist file ##$#%!##%$. Well, I found out -o option to change the name of the downloaded file and it finally helped me to search for the file and the following location was the default directory.
Go to C:\Users[YOUR USER NAME GOES HERE]\AppData\Local\VirtualStore

Related

Access denied executing compiled program

Using Windows, my Hello World code is in src\hello\hello.go.
When using the command "go run hello.go"
Getting Error like this
# command-line-arguments
C:\go\pkg\tool\windows_amd64\link.exe: cannot create $WORK\b001\exe\a.out.exe: open $WORK\b001\exe\a.out.exe: Access is denied.
This can be caused by an anti-virus application like AVG or G-Data.
You can use the -o argument with go run to specify the output directory, and add that path to the exclude list of your anti-virus should this be the cause.
This usually happens when the executable is being edited in some way, or currently running. Check if you have any spare processes of this executable, or in the worst case, try restarting your computer.
Alternatively, it may also be that the linker genuinely does not have write access to the output directory. Make sure that the directory is writable to the user you are compiling your program as.
Adding code folder to the exception list solved the problem.
Windows Security-> Virus and Threat Protection Settings -> Exclutions->Add folder
Add your workplace folder here where your code exists. Adding temp folder didn't work for me.
go build gotest.go ; .\gotest.exe
Using the above command (regular command prompt.) can eliminate pop-up alerts but don't know the reason.

How to fix the error message "the system cannot find the path specified"?

I am trying to run a file in the Outputs_2019 but the command prompt is not recognizing the folder. When I tried to open the folder in the command prompt I get the error message:"the system cannot find the path specified"
I ran the folder path"file:///C:/Users/jfoum/Documents/Outputs/Ouputs_2019" in the google chrome browser and it works.
My end result would be to open a file in that Outputs_2019 folder. I took a screenshot of the issue. Thanks for the help! Please see picture here

Unable to modify permissions of folders on Mac (Mojave)

I am new to Macs and I am trying to run some interesting stats on my iMessages using the code runner extension on VSCode. I've been following this post: https://towardsdatascience.com/heres-how-you-can-access-your-entire-imessage-history-on-your-mac-f8878276c6e9
However, when I run the line conn = sqlite3.connect('/Users/<username>/Library/Messages/chat.db')
I get the error sqlite3.OperationalError: unable to open database file
Based off what I can tell my issue is that VScode doesn't have the right permissions to access the ~/Library/Messages folder and possibly the chat.db as well. First, I ran ls -l on Library and the result is drwx---rwx for Messages. So I tried to use both chmod a+rwx Messages and sudo chmod a+rwx Messages to open permissions to everything but got the error chmod: Unable to change file mode on Messages: Operation not permitted both times.
Am I doing something wrong and/or is there a better way to do this? Or is it just not possible to change the permissions of this folder?
After some more creative searching I discovered that it was an Issue with Mojave's System Integrity Protection (SIP) and can be solved by giving the desired apps full disk access in Settings>Security&Privacy>Privacy>FullDiskAccess.
Solution found here

.exe in artoolkit bin folder not executing and says applpication failed to start correctly

After building the artoolkit.sln in the visual studio and when examples like simpletest1 is made to run the error pops out saying 'Failed to start the application ' ..
Help regarding is really appreciated
Thanks in advance
Ankith
When you install the ARToolkit (i.e extracting the ZIP distribution), All the files are extracted only with Read and Write permissions, but not with execute permissions.
Hence change the permission to Read,Write & Execute (i.e. 777, 755, etc) and then try to run the file. It might run.

WKHTMLTOPDF and "Error: Unable to create temporery file"

I've written a piece of code in PHP to generate PDF using WKHTMLTOPDF binary file. It was working fine till I had to recompile my Apache. Now it fails with error Error: Unable to create temporery file (this is the exact wording).
The situation in which the error is reproducible is a little complicated. I managed to narrow down the error and now I'm pretty sure that the error happens because of the user that Apache runs as. It seems to me that when WKTHMLTOPDF is running as a user with no home folder, it's unable to access a temporary folder within the user's home folder.
Surely I can change the Apache's user but I would rather resolve this problem once and for all. To this end it would be great if I could somehow set the temp folder for WKHTMLTOPDF or at least print its current value to make it valid! Does anyone know how to do any of these two?
BTW, I'm using WKHTMLTOPDF 0.11.0 rc1.
I saw the same error today in Rails4 + pdfkit gem(0.8.2) + wkhtmltopdf(0.12.2.1) under CentOS 6.7.
This error came from wkhtmltopdf and the reason was it couldn't create temporary file. wkhtmltopdf depends on some temporary filename creation API (I'm not sure), but probably following shows some hints:
$ man tempfile
$ man tempnam
In my case, my TMPDIR environment variable showed wrong path (I had accidentaly deleted the directory!) so that wkhtmltopdf couldn't create work file.
When I unset TMPDIR, then it worked! Of course, setting correct existence directory to TMPDIR should be OK too.

Resources