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

--write-info-json file is file peremissin 600 -rw-------- #12471

Closed
niammuddin opened this issue Mar 17, 2017 · 4 comments
Closed

--write-info-json file is file peremissin 600 -rw-------- #12471

niammuddin opened this issue Mar 17, 2017 · 4 comments

Comments

@niammuddin
Copy link

@niammuddin niammuddin commented Mar 17, 2017

Hi dear, I add --write-info-json, but file permission can be download, because file permisson is 600, I need to 644, so for all file .json to 644 permisson, please understand me, thanks

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 17, 2017

Modifying permissions is your responsibility not youtube-dl's. Out of scope.

@dstftw dstftw closed this Mar 17, 2017
@aleksejrs
Copy link

@aleksejrs aleksejrs commented Feb 10, 2019

Why is that different for JSON (600) and thumbnail/video (640)? It seems to only modify the video file.

test$ youtube-dl -v --ignore-config --write-all-thumbnails --write-info-json --write-sub --no-call-home https://www.youtube.com/watch?v=9y2N-p93kF4
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--ignore-config', u'--write-all-thumbnails', u'--write-info-json', u'--write-sub', u'--no-call-home', u'https://www.youtube.com/watch?v=9y2N-p93kF4']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.08
[debug] Python version 2.7.15+ (CPython) - Linux-4.19.0-1-amd64-x86_64-with-debian-buster-sid
[debug] exe versions: ffmpeg 4.1-1, ffprobe 4.1-1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 9y2N-p93kF4: Downloading webpage
[youtube] 9y2N-p93kF4: Downloading video info webpage
WARNING: video doesn't have subtitles
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video description metadata as JSON to: Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.info.json
[youtube] 9y2N-p93kF4: Downloading thumbnail ...
[youtube] 9y2N-p93kF4: Writing thumbnail to: Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.jpg
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https:// (…)'
[download] Destination: Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.f247.webm
[download] 100% of 9.52MiB in 00:01
[debug] Invoking downloader on u'(…)'
[download] Destination: Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.f140.m4a
[download] 100% of 1.59MiB in 00:00
[ffmpeg] Merging formats into "Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.f247.webm' -i 'file:Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.f140.m4a' -c copy -map '0:v:0' -map '1:a:0' 'file:Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.temp.mkv'
Deleting original file Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.f247.webm (pass -k to keep)
Deleting original file Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.f140.m4a (pass -k to keep)
test$ ls -l
insgesamt 11604
-rw------- 1 el el    40561 Feb 10 19:26 'Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.info.json'
-rw-r----- 1 el el   174038 Feb 10 19:26 'Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.jpg'
-rw-r----- 1 el el 11662682 Feb  2 11:40 'Рысь поймала зайца. Удачная съемка на фотоловушку (со звуком).-9y2N-p93kF4.mkv'
test$ 
@ankenyr
Copy link
Contributor

@ankenyr ankenyr commented May 3, 2020

Hi @dstftw I would like to reopen this issue. Does it not seem strange that all the other files are being outputted with permissions 644 but the info.json file is 600? I am experiencing this myself.

@ankenyr
Copy link
Contributor

@ankenyr ankenyr commented May 3, 2020

Took a brief look at this but need to head to sleep. I believe right now that this is due to tempfile.
https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py#L1826

>>> import tempfile
>>> tf = tempfile.NamedTemporaryFile('w')
>>> tf.name
'/tmp/tmp1otz2tn1'
root@athena:~/test# ls -la /tmp/tmp1otz2tn1
-rw------- 1 root root 0 May  3 01:10 /tmp/tmp1otz2tn1

I can try to do more digging tomorrow provided I find time between taking care of my kid to provide a PR unless someone else gets to this first.

@ankenyr ankenyr mentioned this issue May 4, 2020
5 of 9 tasks complete
dstftw pushed a commit that referenced this issue May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.