JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 17.03.2020, 23:04
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Post Creating Channel folder for youtube archiving (Packagizer rule)

I'm looking for jd to create a folder of the youtube channels name then it saves the package folder of the video to that location.

channel1---Pakagename----files
channel2---Pakagename----files
channel3---Pakagename----files

The closet I can get to this is to create a packagizer rule to grab the name of the channel from the packagename and make it save it to that location. The problem is I have to create a packagizer rule for every channel I add.
Reply With Quote
  #2  
Old 17.03.2020, 23:07
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Default

I might be able to find another way to orgize it if I can use the filename rules from the youtube plugin in the packagizer but I assume this is not possible.
Reply With Quote
  #3  
Old 17.03.2020, 23:23
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Default

I guess one more question. Is it possible to have jd make the thumbnail image of a youtube video the thumbnail image of the video file?
Reply With Quote
  #4  
Old 18.03.2020, 12:01
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,087
Default

Hi,
through dynamic rules, you can of course make one rule to grab any channel name you want and use that as packagename.

Because I cannot know your youtube filename settings, I'am unable to help you without knowing these.
If you use the default YT filename settings, I can help you to create such a rule.

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #5  
Old 18.03.2020, 23:02
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Default

Quote:
Originally Posted by pspzockerscene View Post
Hi,
through dynamic rules, you can of course make one rule to grab any channel name you want and use that as packagename.

Because I cannot know your youtube filename settings, I'am unable to help you without knowing these.
If you use the default YT filename settings, I can help you to create such a rule.

-psp-
So I'm currently using the YT plugin to set the package name to the channel name. The only problem is when I download multiple videos from that channel all the files (video,audio,subs,etc) are all placed in that same folder and I can't see a way to make them also have a subfolder for each video. I'd be ok with resetting my file name settings if you think you know of a way.
Reply With Quote
  #6  
Old 19.03.2020, 03:20
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,614
Default

this is how i used todo it with some regex in package customiser, and youtube plugin settings

so plugin settings for youtube, set
packagename to just channel name,
filename as you wish

in the package customiser, set
filename (equals) (.+)\.[a-z0-9]{3,4} and check the regex checkbox
packagename (equals) *
downloadurl (contains) youtube.com/
and then
download path; <jd:orgpackagename:1>/<jd:orgfilename:1>
and packagename you can set back to filename
packagename <jd:orgfilename:1>

gave it a quick test and works.

not sure about using plugin properties for this host due to the way data is kept/used (though it might be possible). I never really looked into it because this rule above worked years prior to them been available .
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]

Last edited by raztoki; 19.03.2020 at 03:22.
Reply With Quote
  #7  
Old 19.03.2020, 06:02
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Post

Quote:
Originally Posted by raztoki View Post
this is how i used todo it with some regex in package customiser, and youtube plugin settings

so plugin settings for youtube, set
packagename to just channel name,
filename as you wish

in the package customiser, set
filename (equals) (.+)\.[a-z0-9]{3,4} and check the regex checkbox
packagename (equals) *
downloadurl (contains) youtube.com/
and then
download path; <jd:orgpackagename:1>/<jd:orgfilename:1>
and packagename you can set back to filename
packagename <jd:orgfilename:1>

gave it a quick test and works.

not sure about using plugin properties for this host due to the way data is kept/used (though it might be possible). I never really looked into it because this rule above worked years prior to them been available .
This works perfectly! Is there a way to have it have all the different files in one folder instead of creating a folder for each file type? Right now it creates a sub package for the video, audio, subtitles, etc. I assume the only way is to set the file names to all be the same. If so it's better than having them all in one folder at least.

Last edited by AlphaSlayer; 19.03.2020 at 06:56.
Reply With Quote
  #8  
Old 19.03.2020, 08:19
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by AlphaSlayer View Post
Right now it creates a sub package for the video, audio, subtitles, etc. I assume the only way is to set the file names to all be the same.
Try this:

Customized Packagename pattern in plugin settings:
Code:
channelname=*CHANNELNAME*packagename=*VIDEO_NAME*

Packagizer rule:
Code:
if : package name : contains : channelname=*packagename=*
set : download directory : <jd:orgpackagename:1>/<jd:orgpackagename:2>
set : package name : <jd:orgpackagename:2>
Reply With Quote
  #9  
Old 19.03.2020, 08:45
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Thumbs up

Quote:
Originally Posted by mgpai View Post
Try this:

Customized Packagename pattern in plugin settings:
Code:
channelname=*CHANNELNAME*packagename=*VIDEO_NAME*

Packagizer rule:
Code:
if : package name : contains : channelname=*packagename=*
set : download directory : <jd:orgpackagename:1>/<jd:orgpackagename:2>
set : package name : <jd:orgpackagename:2>
PERFECT! Every day I love this program more and more and this community!
Reply With Quote
  #10  
Old 19.03.2020, 08:58
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Default

Quote:
Originally Posted by mgpai View Post
Try this:

Customized Packagename pattern in plugin settings:
Code:
channelname=*CHANNELNAME*packagename=*VIDEO_NAME*

Packagizer rule:
Code:
if : package name : contains : channelname=*packagename=*
set : download directory : <jd:orgpackagename:1>/<jd:orgpackagename:2>
set : package name : <jd:orgpackagename:2>
Do you know it is possible to have jd make the thumbnail image of a youtube video the thumbnail image of the video file?
Reply With Quote
  #11  
Old 19.03.2020, 15:24
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by AlphaSlayer View Post
Do you know it is possible to have jd make the thumbnail image of a youtube video the thumbnail image of the video file?
Feature currently not available in JD. Should be possible using external tools in eventscritper, but better if it can be implemented natively.

Wait for developers feedback.
Reply With Quote
  #12  
Old 19.03.2020, 15:25
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,087
Default

Quote:
Originally Posted by mgpai View Post
Feature currently not available in JD. Should be possible using external tools in eventscritper, but better if it can be implemented natively.
Wait for developers feedback.
This is not planned.

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #13  
Old 20.03.2020, 04:44
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Thumbs up

Quote:
Originally Posted by mgpai View Post
Feature currently not available in JD. Should be possible using external tools in eventscritper, but better if it can be implemented natively.

Wait for developers feedback.
Ok well I'll just download the thumbnails now and look for a tool in the future. Thanks again for the help
Reply With Quote
  #14  
Old 21.03.2020, 07:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by AlphaSlayer View Post
Do you know it is possible to have jd make the thumbnail image of a youtube video the thumbnail image of the video file?
Quote:
Originally Posted by mgpai View Post
Feature currently not available in JD. Should be possible using external tools in eventscritper ...
Example script to add cover art to YT videos:
Code:
/*
Add coverr to YT videos
Trigger required: Package Finished
External program used: mkvtoolnix
*/

var mkvpropedit = "d:/apps/mkvtoolnix/mkvpropedit"; // <- set path to mkvpropedit

package.getDownloadLinks().forEach(function(link) {
    if (link.isFinished() && link.getHost() == "youtube.com") {
        var path = getPath(link.getDownloadPath());
        var ext = path.getExtension();
        var video = ["mkv", "webm"];

        if (video.indexOf(ext) > -1 && path.exists()) {
            var id = link.getProperty("YT_ID");

            link.getPackage().getDownloadLinks().some(function(link2) {
                var id2 = link2.getProperty("YT_ID");

                if (id == id2) {
                    var path2 = getPath(link2.getDownloadPath());
                    var ext2 = getPath(path2).getExtension();

                    if (ext2 == "jpg" && path2.exists()) {
                        var result = callSync(mkvpropedit, path, "--attachment-name", "\"cover\"", "--attachment-mime-type", "\"image/jpeg\"", "--add-attachment", path2);
                        return true;
                    }
                }
            })
        }
    }
})

This script uses 'mkvpropedit' to add cover art to YT videos. YT MP4 vidoes are not in matroska container format, so, to add cover art those videos, you will need to convert them to matroska container format first (can use mkvmerge in same script), or use some other external program (in the script, instead of mkvpropedit) which supports all container formats .
Reply With Quote
  #15  
Old 22.03.2020, 01:27
AlphaSlayer AlphaSlayer is offline
Wind Gust
 
Join Date: Sep 2019
Posts: 40
Default

Quote:
Originally Posted by mgpai View Post
Example script to add cover art to YT videos:
Code:
/*
Add coverr to YT videos
Trigger required: Package Finished
External program used: mkvtoolnix
*/

var mkvpropedit = "d:/apps/mkvtoolnix/mkvpropedit"; // <- set path to mkvpropedit

package.getDownloadLinks().forEach(function(link) {
    if (link.isFinished() && link.getHost() == "youtube.com") {
        var path = getPath(link.getDownloadPath());
        var ext = path.getExtension();
        var video = ["mkv", "webm"];

        if (video.indexOf(ext) > -1 && path.exists()) {
            var id = link.getProperty("YT_ID");

            link.getPackage().getDownloadLinks().some(function(link2) {
                var id2 = link2.getProperty("YT_ID");

                if (id == id2) {
                    var path2 = getPath(link2.getDownloadPath());
                    var ext2 = getPath(path2).getExtension();

                    if (ext2 == "jpg" && path2.exists()) {
                        var result = callSync(mkvpropedit, path, "--attachment-name", "\"cover\"", "--attachment-mime-type", "\"image/jpeg\"", "--add-attachment", path2);
                        return true;
                    }
                }
            })
        }
    }
})

This script uses 'mkvpropedit' to add cover art to YT videos. YT MP4 vidoes are not in matroska container format, so, to add cover art those videos, you will need to convert them to matroska container format first (can use mkvmerge in same script), or use some other external program (in the script, instead of mkvpropedit) which supports all container formats .
Sweet. I will try this out sometime tomorrow when I'm free.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 16:44.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.