allejok96 / jw-scripts

Index or download videos and sound recordings from jw.org.
GNU General Public License v3.0
49 stars 10 forks source link

Downloads are flat #1

Closed bachato closed 8 years ago

bachato commented 8 years ago

jwb-index downloads seem to be flat (no subdirectories) by default. I am running the script with flags [--quality 999 --download "/directory/to/download/"]. Am I doing something incorrectly?

allejok96 commented 8 years ago

If you mean that all video files are saved in one directory, that's the intended behaviour. Before I did the rewrite, files were organized in directories, and every file contained one link. After I did the rewrite, the "directory structure" is inside the files, which are playlists. All playlists are saved in one directory, and if you use the flag --download, all videos will be saved in one directory too.

If organizing files in directories is the way you work, I could try to re-implement that. I've never used Plex. How does it work if you open the m3u files that jwb-index creates in Plex? Do Plex flip out like VLC or is it like browsing a folder, like Kodi does? I know that you prefer having them downloaded. Just wondering.

bachato commented 8 years ago

Plex doesn't seem to recognize the .m3u files so I cannot use them. I would like if possible an option to use the directory structure which Plex can see which will allow me to navigate the videos.

Thanks for putting this script together.

bachato commented 8 years ago

OK after looking through some of the Plex documentation for adding personal videos which is what these are considered at this point, there is a naming convention that needs to be used in order to get the names to display properly (Show>Season>Episode) (my grouping is Category(ie Monthly Program or Talks or News and Announcements...)>Year>Episode/File) and you have to choose "TV Shows" as the library type but you can rename the library however you like. The you have to go into settings and set the local media agent as the first agent for TV Shows. Then the names will be correctly retrieved from the metadata. The current metadata isn't the best for Plex because Plex sees the monthly programs as the same file with multiple version and not as an individual file for each month so renaming the file may need to be done in order for them to display properly.

allejok96 commented 8 years ago

Hm, I might have a solution for you, if the m3u playlists is working with Plex... Working on it right now. Please let me know how opening the m3u files generated without the --download flag works.

bachato commented 8 years ago

Plex does not see the m3u files at all only video files.

allejok96 commented 8 years ago

That made things a bit tricker. But nothing is impossible, I will look into it. Meanwhile you can use this one liner: find /dir/with/strm/files -name "720p.strm" -execdir wget -i {} \; To download the videos when using the old kodiator.sh script.

bachato commented 8 years ago

ok great thanks. I need to play around with these files as well I had to manually rename them to get them to display properly in Plex and then I had to change some things in Plex as well. Also the naming scheme/convention I mentioned earlier wasn't actually the file naming convention, it was the folder structure so sorry for misstating that. the naming convention is Show - s00e00 - episode.

allejok96 commented 8 years ago

What did you do with the strm files to get plex to play them?

bachato commented 8 years ago

nothing Plex saw them and I tried playing one of the 240p but it never loaded.

allejok96 commented 8 years ago

Sorry I'm a bit confused

I need to play around with these files as well I had to manually rename them to get them to display properly in Plex and then I had to change some things in Plex as well.

Did you refer to the strm files or the files downloaded by the oneliner?

allejok96 commented 8 years ago

Because if you got something working somehow, I can put that in the script.

bachato commented 8 years ago

yes I am using the oneliner manually and it correctly grabs the file[s] based on quality. I did add --limit-rate and -nc with wget so as not to overload the bandwith of the site and to skip existing files.

bachato commented 8 years ago

Sorry I'm a bit confused

I need to play around with these files as well I had to manually rename them to get them to display properly in Plex and then I had to change some things in Plex as well.

Did you refer to the strm files or the files downloaded by the oneliner?

Sorry if I confused you. I was refering to getting the filenames to display correctly in Plex in the statement above. I had to manually edit the mp4 filenames/metadata themselves as well as making some changes in Plex directly related to the files as well. It had nothing to do with the strm files at that point

Does that help clarify things?

allejok96 commented 8 years ago

Yes. I just wondered if Plex could play the strm files, simply if you gave them another filename. But now I see you meant the mp4 files.

I'm testing out some improvements to the script that I hope will solve this. Since Plex' system of organizing things is quite different than the way things are organized in JWB you will have to use the "Home Videos" mode when adding a library...

allejok96 commented 8 years ago

I've now added the --filesystem option with combined with --download should solve your problems - if you use the "Home Videos" mode in Plex. And thanks for the --limit-rate tip, I've added a default limit, with you can change.

The --latest flag now adds the videos to their corresponding categories, so regularly running a cron job with that should keep things up to date.

Run it without the --latest flag, and with the --clean flag once in a while to tidy things up.

Let me know how it works out for you!

bachato commented 8 years ago

Great thanks, I have tested it out and things look good. What exactly is the --clean tag doing? I did notice at one point some temp folders that existed when using the find command from above. I assumed they were for items that may change frequently such as featured items.

allejok96 commented 8 years ago

Glad to hear it works!

Simple answer: Actually the temp folder (if you mean the "jwb-LANG" folder) is for all the items. The --clean flag removes everything except the downloaded video files. In other words, it does a fresh start.

Complex answer: In the destination folder you specify there will be created a jwb-LANG dir containing (directly) all the video files and dirs named after the category code names. The dirs contain symlinks to other dirs or videos. The script will keep adding links here, and never check if anyone should be removed. This can be a problem, especially for the "Featured" categories. The --clean flag removes all this before start. One could use the clean flag every time the script runs without the --latest flag, BUT then the script would have to finish before all categories were restored. And if you wanted to watch something meanwhile, you would have to wait.

Closing this issue now.