Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoder is broken : PermissionError: [Errno 13] Permission denied: '/var/www/.cache' #501

Open
gamersalpha opened this issue Mar 29, 2023 · 7 comments

Comments

@gamersalpha
Copy link

Hello i can't encode anymore video do u have information about this error please ?

[29-Mar-2023 21:21:37 Europe/Berlin] youtubeDl::addVideo We could not get the title () of your video (https://www.youtube.com/watch?v=wjNxTyEZBMc&&index=18)
[29-Mar-2023 21:21:49 Europe/Berlin] getTitleFromLink: Get Title Error: LC_ALL=en_US.UTF-8 /usr/local/bin/youtube-dl   --no-check-certificate --no-playlist --force-ipv4 --skip-download -e 'https://www.youtube.com/watch?v=wjNxTyEZBMc&&index=18'
Array
(
    [0] => WARNING: Writing cache to '/var/www/.cache/youtube-dl/youtube-sigfuncs/js_931a8913_106.json' failed: Traceback (most recent call last):
    [1] =>   File "/usr/local/lib/python3.8/dist-packages/youtube_dl/cache.py", line 49, in store
    [2] =>     os.makedirs(os.path.dirname(fn))
    [3] =>   File "/usr/lib/python3.8/os.py", line 213, in makedirs
    [4] =>     makedirs(head, exist_ok=exist_ok)
    [5] =>   File "/usr/lib/python3.8/os.py", line 213, in makedirs
    [6] =>     makedirs(head, exist_ok=exist_ok)
    [7] =>   File "/usr/lib/python3.8/os.py", line 223, in makedirs
    [8] =>     mkdir(name, mode)
    [9] => PermissionError: [Errno 13] Permission denied: '/var/www/.cache'
    [10] =>
    [11] => WARNING: Writing cache to '/var/www/.cache/youtube-dl/youtube-sigfuncs/js_931a8913_102.json' failed: Traceback (most recent call last):
    [12] =>   File "/usr/local/lib/python3.8/dist-packages/youtube_dl/cache.py", line 49, in store
    [13] =>     os.makedirs(os.path.dirname(fn))
    [14] =>   File "/usr/lib/python3.8/os.py", line 213, in makedirs
    [15] =>     makedirs(head, exist_ok=exist_ok)
    [16] =>   File "/usr/lib/python3.8/os.py", line 213, in makedirs
    [17] =>     makedirs(head, exist_ok=exist_ok)
    [18] =>   File "/usr/lib/python3.8/os.py", line 223, in makedirs
    [19] =>     mkdir(name, mode)
    [20] => PermissionError: [Errno 13] Permission denied: '/var/www/.cache'
    [21] =>
    [22] => ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
)

First i update youtube-dll :

sudo pip install -U youtube-dl
Requirement already up-to-date: youtube-dl in /usr/local/lib/python3.8/dist-packages (2021.12.17)

so now i can't understand why Avideo-encoder wants writer in /var/www/.cache

and i also tries this :

stagiaire@srv-web-01:/var/www$ /usr/local/bin/youtube-dl -C  --no-check-certificate --no-playlist --force-ipv4 --skip-download -e 'https://www.youtube.com/watch?v=wjNxTyEZBMc&&index=18'
ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.


can u explain me what's is wrong please

thanks

@DanielnetoDotCom
Copy link
Member

The error message suggests that the user running the youtube-dl command does not have permission to create directories in the /var/www/.cache directory. You may need to adjust the permissions of this directory to allow the user to create directories and files inside it.

One way to do this is to use the chmod command to change the owner and group of the directory to the user running the youtube-dl command. For example, you can use the following command to change the owner and group of the directory to the user www-data (replace www-data with the appropriate user for your system):

sudo chown -R www-data:www-data /var/www/.cache

This command changes the owner and group of the /var/www/.cache directory and all of its contents recursively (-R option) to www-data. Once the ownership is set correctly, the user running the youtube-dl command should have permission to create directories and files in the directory.

@gamersalpha
Copy link
Author

Greetings,

I am facing an issue with my web application which appears to be related to the youtube-dl program installed on my Ubuntu server. This is a known problem that has been reported on the following GitHub pages: yt-dlp/yt-dlp#6247 and ytdl-org/youtube-dl#31530. Fortunately, a solution has been proposed on yt-dlp/yt-dlp#3766.

To resolve this issue, I removed the previously installed youtube-dl program by executing the command: "sudo pip remove youtube-dl". Then, I installed the new program using the following commands:

sudo add-apt-repository ppa:tomtomtom/yt-dlp    # Add ppa repo to apt
sudo apt update                                 # Update package list
sudo apt install yt-dlp                         # Install yt-dlp

I attempted to change the executable name of youtube-dl by searching through several source code files, including videos/configuration.php, objects/Configuration.php, objects/Configuration.php, and objects/include_config.php. Unfortunately, I was unable to locate the specific line of code that would allow me to change the name. Instead, I opted to change the name manually by executing the following command:

sudo mv /usr/bin/yt-dlp /usr/bin/youtube-dl

In the future, I am curious to see if AVIDEO will be able to automatically detect the correct program name installed on the server. Thank you for your attention to this matter.

I hope that this solution can be useful for others who may encounter a similar issue.

@DanielnetoDotCom
Copy link
Member

if you install the yt-dlp in your server, AVideo will use it automatically

@gamersalpha
Copy link
Author

ok so look what i have :
i lunch in comand line :

image

ok now i try to upluoad a video :

image

and like see, Avideo don't detect it

@DanielnetoDotCom
Copy link
Member

Run this and try again

sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && sudo chmod a+rx /usr/local/bin/yt-dlp

@gamersalpha
Copy link
Author

Looks work but got a new error :/

image

on log i got this :


Array
(
    [0] => Halsey & Kelsea Ballerini Perform 'Without Me' | CMT Crossroads
)

[30-Mar-2023 08:01:45 Europe/Berlin] decideFormatOrder: {"videoURL":"https:\/\/www.youtube.com\/watch?v=Leex4LSf6aY&list=RDLeex4LSf6aY&start_radio=1","audioOnly":"false","spectrum":"false","webm":"false","override_status":"","update_video_id":0,"inputHLS":"false","inputLow":"false","inputSD":"false","inputHD":"false","inputAutoHLS":"false","inputAutoMP4":"false","inputAutoWebm":"false","inputAutoAudio":"true","categories_id":3,"releaseDate":"2023-03-30 08:00","notifyURL":""}
[30-Mar-2023 08:01:45 Europe/Berlin] decideFormatOrder: auto Audio
[30-Mar-2023 08:01:45 Europe/Berlin] AVideo-Encoder Format::getFromOrder(60)
[30-Mar-2023 08:01:45 Europe/Berlin] Encoder::sendFile videos_id=0, format=mp3
[30-Mar-2023 08:01:46 Europe/Berlin] Encoder::sendFile sending file to aVideoEncoder.json from
[30-Mar-2023 08:01:46 Europe/Berlin] sendToStreamer to aVideoEncoder.json
[30-Mar-2023 08:01:46 Europe/Berlin] Encoder::save id=() title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer spectrumimage not set
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer rawVideo not set
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer image not set
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer gifimage not set
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer webpimage not set
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer video not set
[30-Mar-2023 08:01:47 Europe/Berlin] sendToStreamer https://youtube.serveur.fr/YouPHPTube/aVideoEncoder.json in 0.096 seconds {"error":false,"target":"aVideoEncoder.json","postFields":{"duration":"EE:EE:EE","title":"Halsey & Kelsea Ballerini Perform 'Without Me' | CMT Crossroads","first_request":1,"categories_id":3,"format":"mp3","resolution":"","videoDownloadedLink":"https:\/\/www.youtube.com\/watch?v=Leex4LSf6aY&&start_radio=1","description":"\"Does it ever get lonely? Thinking you could live without me.\" Yes, queens! \ud83d\ude4c \ud83d\udc51 This is one serious powerhouse performance of 'Without Me' by Kelsea Ballerini and Halsey.\n\n#KelseaBallerini #Halsey #CMT #Crossroads\n\nSUBSCRIBE now for more CMT Crossroads: https:\/\/bit.ly\/2KPSNQD\n\nFor updates on all things country, follow CMT!\nCrossroads on CMT: http:\/\/www.cmt.com\/shows\/cmt-crossroads\nCMT on FB: https:\/\/www.facebook.com\/CMTCrossroads\/\nCMT on Twitter: https:\/\/twitter.com\/cmt\nCMT on Instagram: https:\/\/www.instagram.com\/cmt\/\n\nGreat music knows no boundaries. CMT Crossroads shows the far-reaching roots of country music by pairing country artists with musicians from other genres. Each episode will feature a different set of stars playing together, swapping stories and sharing their common love of music.","downloadURL":"","chunkFile":"","encoderURL":"https:\/\/youtube.serveur.fr\/YouPHPTube-Encoder\/","keepEncoding":"0","streamers_id":"4","user":"issa2020","pass":"_user_hash_dWFDVlB0SWMybFU4WWNMbzVvZ0RZbXRrek1uUnFwNjJCMGdPeFk0Y285MCs4Uld3T2JPeFBoRE9DT2VFOUtoSUxHSUc1WUtOUXMvUnVscDMwaVFFVmc9PQ==","return_vars":"{\"videos_id\":0,\"video_id_hash\":\"\",\"releaseDate\":\"2023-03-30 08:00\"}","releaseDate":"2023-03-30 08:00"},"response_raw":"{\"error\":false,\"video_id\":false,\"video_id_hash\":\"Qnhjb1hiQkRsSjZSYk1FekQ0QWROcVFqWmxOMm1PZ1p1N2J4VjV1QkE2UT0=\",\"releaseDate\":\"2023-03-30 08:00\"}","response":{"error":false,"video_id":false,"video_id_hash":"Qnhjb1hiQkRsSjZSYk1FekQ0QWROcVFqWmxOMm1PZ1p1N2J4VjV1QkE2UT0=","releaseDate":"2023-03-30 08:00"}}
[30-Mar-2023 08:01:47 Europe/Berlin] Encoder::save id=(17) title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:01:51 Europe/Berlin] getReturn_vars {"videos_id":0,"video_id_hash":"Qnhjb1hiQkRsSjZSYk1FekQ0QWROcVFqWmxOMm1PZ1p1N2J4VjV1QkE2UT0=","releaseDate":"2023-03-30 08:00"}
[30-Mar-2023 08:01:51 Europe/Berlin] Encoder::save id=(17) title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:01:51 Europe/Berlin] Encoder::save id=(17) title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:01:51 Europe/Berlin] downloadFile: start queue_id = 17  url = https://www.youtube.com/watch?v=Leex4LSf6aY&&start_radio=1 pathFileName = /var/www/html/YouPHPTube-Encoder/videos/17_tmpFile.mp4
[30-Mar-2023 08:01:51 Europe/Berlin] getYoutubeDl: Getting from Youtube DL /usr/local/bin/yt-dlp   --no-check-certificate --force-ipv4 --no-playlist -k -o /tmp/youtubeDlcN3iXE.mp4 -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' 'https://www.youtube.com/watch?v=Leex4LSf6aY&&start_radio=1' [{"file":"\/var\/www\/html\/YouPHPTube-Encoder\/objects\/Encoder.php","line":470,"function":"getYoutubeDl","class":"Encoder","type":"::"},{"file":"\/var\/www\/html\/YouPHPTube-Encoder\/objects\/Encoder.php","line":968,"function":"downloadFile","class":"Encoder","type":"::"},{"file":"\/var\/www\/html\/YouPHPTube-Encoder\/view\/run.php","line":6,"function":"run","class":"Encoder","type":"::"}]
[30-Mar-2023 08:02:15 Europe/Berlin] getYoutubeDl: Copying [/tmp/youtubeDlcN3iXE.mp4] to [/var/www/html/YouPHPTube-Encoder/videos/17_tmpFile.mp4]
[30-Mar-2023 08:02:15 Europe/Berlin] downloadFile:getYoutubeDl SUCCESS queue_id = 17
[30-Mar-2023 08:02:15 Europe/Berlin] Encoder::save id=(17) title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:02:15 Europe/Berlin] downloadFile: {"error":false,"filename":"17_tmpFile.mp4","pathFileName":"\/var\/www\/html\/YouPHPTube-Encoder\/videos\/17_tmpFile.mp4","msg":"We downloaded the file with success"}
[30-Mar-2023 08:02:15 Europe/Berlin] Original filesize is 98.79MB
[30-Mar-2023 08:02:15 Europe/Berlin] Encoder::save id=(17) title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:02:15 Europe/Berlin] try [1] return_vars->videos_id is empty {"videos_id":0,"video_id_hash":"Qnhjb1hiQkRsSjZSYk1FekQ0QWROcVFqWmxOMm1PZ1p1N2J4VjV1QkE2UT0=","releaseDate":"2023-03-30 08:00"}
[30-Mar-2023 08:02:15 Europe/Berlin] Encoder::save id=(17) title=(Halsey & Kelsea Ballerini Perform \'Without Me\' | CMT Crossroads)
[30-Mar-2023 08:02:15 Europe/Berlin] getReturn_vars {"videos_id":0,"video_id_hash":"Qnhjb1hiQkRsSjZSYk1FekQ0QWROcVFqWmxOMm1PZ1p1N2J4VjV1QkE2UT0=","releaseDate":"2023-03-30 08:00"}

@DanielnetoDotCom
Copy link
Member

first, try to update your streamer and encoder.

if still fails share a more complete encoder log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants