johang/btfs

[Question] How does btplay actually work?

pitsi opened this issue · 4 comments

pitsi commented

I would like to know how btplay actually works, because I think something is not right on my end and its man page did not help me much.
So, let's take the simple example of btplay "magnet:?xt=blablabla". I run this and, after like 30 seconds of no output on the terminal, mpv starts playing the video file in that torrent. Is it normal to have no output in the terminal?
At the same time, a folder named like "btplay-1234abcd" is created in /tmp/ and another one named like "btfs-123abc" is created under ~/btfs/. Both folders contain a folder with the name of the torrent and its contents, and none of the 2 is a symlink of the other.
When exiting the player, the folder in /tmp/ is deleted but the folder in ~/btfs/ is left untouched, and I think the dowload continues until completion. Is this normal too? If so, how can I make btplay delete that folder too?

Debian testing/unstable x64, btfs 2.24, python 3.10.5, libtorrent 2.0.6, mpv 0.34.1 and mplayer 1.5

pitsi commented

Two things I found so far. The folder in ~/btfs/ is where the file is actually downloaded and played by the player, while the folder in /tmp/ is where the previous folder is mounted.

Read the script. It's in the script directory.

But yes, your finding are correct. It will unmount and stop downloading when the player exits.

pitsi commented

I have read the btplay script, I have read its man page as well.
But none answers the questions on why the folder inside ~/btfs/ remains after playback stops or if it (= btfs obviously) keeps downloading the torrent after btplay has exited.

pitsi commented

Closing because I noticed that the script now deletes anything inside ~/btfs after playback stops. And it happens regardless if I exit the player with "q" or from the x button of the window manager.
Moreover, a couple of things have changed since I opened this issue. I begun learning python ~2 months ago and I installed a lot of its libs for stuff I want to create, so maybe an extra lib did the work.
Also, debian went from python 3.10.x to 3.11.x since then.