Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Text file busy (os error 26) when trying to download a video #62

Closed
fiveraptor opened this issue Feb 24, 2023 · 8 comments
Closed

Text file busy (os error 26) when trying to download a video #62

fiveraptor opened this issue Feb 24, 2023 · 8 comments

Comments

@fiveraptor
Copy link

I am on a M1 mac and have tried it according to instructions with docker. however, always comes this error:

docker run -it --rm -v ${PWD}:/home/Infinite-Storage-Glitch isg ./target/release/isg_4real
Welcome to ISG (Infinite Storage Glitch)
This tool allows you to turn any file into a compression-resistant video that can be uploaded to YouTube for Infinite Storage:tm:

How to use:
1. Zip all the files you will be uploading
2. Use the embed option on the archive (THE VIDEO WILL BE SEVERAL TIMES LARGER THAN THE FILE, 4x in case of optimal compression resistance preset)
3. Upload the video to your YouTube channel. You probably want to keep it up as unlisted
4. Use the download option to get the video back
5. Use the dislodge option to get your files back from the downloaded video
6. PROFIT

> Pick what you want to do with the program Download
> What is the url to the video ? https://youtu.be/8I4fd_Sap-g
Starting the download, there is no progress bar
Error: io error: Text file busy (os error 26)

Caused by:
    Text file busy (os error 26)
@Shyvadi
Copy link

Shyvadi commented Feb 24, 2023

Lol, got the exact error minutes after you

@beyse
Copy link
Contributor

beyse commented Feb 24, 2023

I got the same issue yesterday when I first tried running it from the Docker container.

This is not a solution, but a workaround: I used a 3rd party tool (like any "YouTube Video Downloader" Website) to download the video and copied it into the repository folder. I could then successfully decode the video into the zip file.

@beyse
Copy link
Contributor

beyse commented Feb 24, 2023

In an attempt to investigate the problem I changed the code in download.rs to:

    println!("Starting the download, there is no progress bar");
    let output = YoutubeDl::new(&args.url.expect("No URL in params when run_download"))
        .youtube_dl_path(".")
        .format("best")
        .download(true)
        .run();

    let _video = output?.into_single_video().unwrap();

And now the error is a different one:

Starting the download, there is no progress bar
Error: io error: Permission denied (os error 13)

Caused by:
    Permission denied (os error 13)

First I thought the issue might occur because the app cannot write into the working directory. But I can rule this out because I verified with a quick test that the program can indeed create and write into a file.

@Shyvadi
Copy link

Shyvadi commented Feb 25, 2023

Perhaps the method download is lacking permissions? or is in a place where permissions need sudo?

@beyse
Copy link
Contributor

beyse commented Feb 25, 2023

If my understanding of the youtube_dl crate is correct, then it downloads the yt-dlp app as binary to the system and then invokes it before parsing it’s json output.

Somewhere in the process there must be a permission issue with the docker container.

@Shyvadi The user in the docker container is root, so missing sudo likely is not the exact problem here.

@ayhamo
Copy link

ayhamo commented Feb 26, 2023

@beyse Would you explain more on how did you do it? downlaoded the video, where did you put it exactly and how did you decode it?

@beyse
Copy link
Contributor

beyse commented Feb 26, 2023

@ayhamo Yes, so here is a step by step guide:

This guide assumes you have isg_4real built and already ran it and received the Text file busy (os error 26) error.

Inside the target/release you should see the yt-dlp binary. This is the tool used by the application to download the videos.

Step 1 - Preparation

Navigate into the binary folder using cd target/release

Step 2 - Check Stuff

Make sure you have the yt-dlp using ls. For me it looks like this:

build  deps  examples  g  incremental  isg_4real  isg_4real.d  yt-dlp

If you don't have this. Run isg_4real and try to download a video. It will download yt-dlp then first before it crashes with the error reported in this issue.

Step 3 - Download Video

Download the video from YouTube

./yt-dlp -f mp4 -o video.mp4 VIDEO_URL

For example I used:

./yt-dlp -f mp4 -o video.mp4 https://www.youtube.com/watch?v=itrkrlFysvM

This will create a file called video.mp4 in the same folder (target/release).

Step 4 - Decode

You are now ready to decode the video using isg_4real. You could just start it up using

./isg_4real

and use the text-based user interface to decode the video or use the command line like this:

./isg_4real dislodge -i video.mp4 -o decoded.mp4

Where -i is the path to the encoded video file we just downloaded and -o specifies the output path where the decoded file should go.

Note
You must know the file format of the output file beforehand. Some people would use a .zip file, the person who uploaded this video encoded a .mp4 file and I happened to correctly guess the file format (because I took a look at the file using a HEX editor, but anyway...)

After that you can play the video file and you should see something like this:

image

@beyse
Copy link
Contributor

beyse commented Feb 26, 2023

I think I found a solution to the problem @fiveraptor @Shyvadi. Please checkout my branch from the #72. If it works for you now I would call it resolved.

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

No branches or pull requests

4 participants