Closed wavy-baby closed 2 years ago
Hi, Can you share your OS info? Also - Can you run it with RUST_LOG=debug reddsaver -d ~/reddit/image -e user.env
and paste the output here (removing any sensitive information)? That would help with debugging the issue.
OS is Arch Linux
Edit: This is only the last part, not the full log
[2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 16384 bytes [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 16384 bytes [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 6272 bytes [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 10882 bytes [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::conn] incoming body completed [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 16384 bytes [2022-01-04T04:13:26Z DEBUG reddsaver::download] Bytes length of the data: 1320322 [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 16384 bytes [2022-01-04T04:13:26Z DEBUG reddsaver::download] Created a file: /home/wavy/reddit/images/blackmagicfuckery/img-1a0ead8ec3f572fa3e9adaa839ef7893.mp4..mp4 [2022-01-04T04:13:26Z INFO reddsaver::download] Successfully saved media: /home/wavy/reddit/images/blackmagicfuckery/img-1a0ead8ec3f572fa3e9adaa839ef7893.mp4..mp4 from url https://v.redd.it/n1olrcmt9ju71/DASH_audio.mp4 [2022-01-04T04:13:26Z DEBUG reddsaver::download] Media type: RedditVideoWithAudio [2022-01-04T04:13:26Z DEBUG reddsaver::download] Media files: 2 [2022-01-04T04:13:26Z DEBUG reddsaver::download] Locally skipped items: 0 [2022-01-04T04:13:26Z DEBUG reddsaver::download] Assembling components together [2022-01-04T04:13:26Z DEBUG reddsaver::download] Executing command: "ffmpeg" "-i" "/home/wavy/reddit/images/blackmagicfuckery/img-44f5a045a48f97ce18e4abdce5ab9fb4.mp4..mp4" "-i" "/home/wavy/reddit/images/blackmagicfuckery/img-1a0ead8ec3f572fa3e9adaa839ef7893.mp4..mp4" "-c" "copy" "-map" "1:a" "-map" "0:v" "/tmp/.tmp9rp9h0/combined.mp4" [2022-01-04T04:13:26Z DEBUG reddsaver::download] Successfully combined into temporary file: "/tmp/.tmp9rp9h0/combined.mp4" [2022-01-04T04:13:26Z DEBUG reddsaver::download] Renaming file: /tmp/.tmp9rp9h0/combined.mp4 -> /home/wavy/reddit/images/blackmagicfuckery/img-44f5a045a48f97ce18e4abdce5ab9fb4.mp4 [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 16384 bytes [2022-01-04T04:13:26Z DEBUG hyper::proto::h1::io] read 16384 bytes Error: IoError(Os { code: 18, kind: Other, message: "Invalid cross-device link" })
Btw I checked the downloaded files and sometimes the audio is not merged with the video.
The issue seems to be happening when trying to combine the video with audio. Currently the audio and video is downloaded separately and then combined using ffmpeg into /tmp
and then moved to the target location (and delete the individual audio, video components) - are /tmp
and /home/wavy
on different filesystems? or do you have any non-standard filesystem or partitioning scheme?
I don't think so Here is my "tree -L 1 /" output
/ ├── bin -> usr/bin ├── boot ├── dev ├── etc ├── home ├── lib -> usr/lib ├── lib64 -> usr/lib ├── lost+found ├── mnt ├── opt ├── proc ├── root ├── run ├── sbin -> usr/bin ├── srv ├── sys ├── timeshift ├── tmp ├── usr └── var
and here is my fdisk -l output
Device Start End Sectors Size Type /dev/nvme0n1p1 2048 1048576 1046529 511M EFI System /dev/nvme0n1p2 1050624 1000215182 999164559 476.4G Linux filesystem
Interesting. Can you share few Reddit video links on your saved list (including ones that didn't get merged correctly)? I can try to see if I can reproduce this on a Arch Linux system.
I ran into this error last night. My /tmp
dir and the final destination are on different mount points in my case. Looking at the code I discovered that the temp_dir function looks at the TMPDIR
env var.
I then created a tmp
directory on the same mount point as the final destination and then when I ran this it worked:
env -i PATH=$PATH TMPDIR=/opt/tmp/ reddsaver --data-dir /opt/stuff
This is great, thanks @bradym. I will add this info to a troubleshooting section on the README.