JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 28.11.2017, 19:00
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default Script to renaming

Let's imagine that i want the detect files to be named in a predefined way
for example, we would import a file containing this informations:
"desired file name" ::: "link"
etc.
and we would get this "name" for the file found via this "link" ...

Is there already a script for this ? Or so it should be ;-)
Reply With Quote
  #2  
Old 28.11.2017, 19:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You can use the packagizer and create rule that parses name from URL
similiar to this one
https://board.jdownloader.org/showpo...82&postcount=4

Feel free to ask if you have further questions about this
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 28.11.2017, 21:51
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

No, because I'm talking about giving each file a specific name
Name that would be totally independent of linkgrabber analyzes ...
(This would even give names to files / links not supported by jd2 ;-)
Reply With Quote
  #4  
Old 29.11.2017, 09:45
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Did you even try or read it?
Via packagizer you can do exactly that.
You simply append you *wish* name at the end of the url
Code:
url#name=Hello.zip
and use Packagizer rule to parse the given name and use it for filename
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 29.11.2017, 15:04
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Sorry but if i understand correctly, "hello.zip" must be predefined and will be the same for all ?
I wish he could have no connection with anything and that supplants all the other rules...
ex.:
if i write in the file, for example "dadada" ::: "www .... com/hello.zip"
the result for all the files found for this link would be: "dadadahello.zip" or (depending on any settings) "dadada.zip" ...
and if another time i write in file "blablabla" ::: "www .... com/hello.zip"
the result for all the files found for this link would be: "blablablahello.zip" or (depending on any settings) "blablabla.zip" ...
etc.

So that every link written in the file, would integrate the name assigned to it manually, name that can be different for each of them and each time, since it depends on what is written in the file (even if they come all from the same site or not)

It would be a bit like a custom "linkcollectorList.zip"
Reply With Quote
  #6  
Old 29.11.2017, 15:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

I'm sorry but I understood that you want to tell JDownloader for each url what filename to set
URL1#name=Test1.zip
URL2#name=Test2.zip

Of course this only works when URL1 results in one url. You can also use to append something to name.

But that is what you wrote
Code:
"desired file name" ::: "link"
I instead of name:link, it is link#name=name
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 29.11.2017, 17:07
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

"..." ::: "..." is an example of possible syntax but that's you who decide ;-)
In any case it would be nice if one day you allow this possibility
It would also be very convenient to name videos when a site is not supported by JD
Reply With Quote
  #8  
Old 29.11.2017, 17:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

I'm sorry but I dont see any difference between

Code:
"desired file name" ::: "link"
and
Code:
link#name=desired file name
same outcome, just different syntax.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 29.11.2017, 20:18
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Yes, my syntax is just an example, the important thing is my proposal ;-)
But now i understand that my script/plugin proposal seems, at first sight, strange and useless
Reply With Quote
  #10  
Old 29.11.2017, 20:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

I'm sorry but I still don't know what the problem is?
What you ask for is already possible.
Either you do it via Packagizer Rule or you write an Eventscripter script that loads the file and renames the existing links in list.

adding links with predefined names is no big deal
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 29.11.2017, 22:07
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

I admit that i do not see how to do this via the rules since it does not depend on any information obtained in the linkgrabber
And the script i do not know if i will be able to do it ... :-s
Reply With Quote
  #12  
Old 30.11.2017, 10:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Example link
Code:
https://board.jdownloader.org/Nothing.zip#name=Yeah.zip
https://board.jdownloader.org/Nothing2.zip#name=Yeah2.zip
https://board.jdownloader.org/Nothing3.zip#name=Yeah3.zip
instead of
Code:
Yeah.zip:::https://board.jdownloader.org/Nothing.zip
Yeah2.zip:::https://board.jdownloader.org/Nothing2.zip
Yeah3.zip:::https://board.jdownloader.org/Nothing3.zip
ALWAYS JUST ONE SINGLE RULE
Packagizer Rule
Code:
SourceURL contains
.*#name=(.+)
enable regex checkbox

then set
filename to <jd:source:1>
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 01.12.2017 at 10:54.
Reply With Quote
  #13  
Old 30.11.2017, 21:58
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Ok but if the name we want to give is not in the links or anywhere else ... and we want to name each file individually, i really do not see how we could do it with this method :-s

Last edited by Mistery; 30.11.2017 at 23:13.
Reply With Quote
  #14  
Old 01.12.2017, 01:04
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,611
Default

like you said earlier you do this yourself, based on what ever data or naming scheme you want.
Quote:
if i write in the file, for example "dadada" ::: "www .... com/hello.zip"
just use the syntax and package customiser rule jiaz mentioned earlier and JD will parse for your custom name.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #15  
Old 01.12.2017, 10:21
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

There is no schema, the name is totally personalized.
If you make a rule you always have the same result and so there should be a rule for each file
(and do not forget the cases where jd does not support the link or there is no name in the url ...).
I speak of a kind of "linkgrabber.zip" but built manually ...
The script to get this file i can do it without problem, stay more than jd take it into account ;-)
Reply With Quote
  #16  
Old 01.12.2017, 10:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@mistery: you don't have to do a rule for each file!
the packagizer rule, see https://board.jdownloader.org/showpo...6&postcount=12
works for every file.
there is only ONE rule that works for ALL files
__________________
JD-Dev & Server-Admin
Reply With Quote
  #17  
Old 01.12.2017, 10:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Quote:
Originally Posted by Mistery View Post
If you make a rule you always have the same result and so there should be a rule for each file
WRONG: ONE RULE for all

Quote:
Originally Posted by Mistery View Post
(and do not forget the cases where jd does not support the link or there is no name in the url ...)
WRONG: it doesn't matter what name JDownloader will give the link. YOU SPECIFY the name of the link
__________________
JD-Dev & Server-Admin
Reply With Quote
  #18  
Old 01.12.2017, 21:27
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

I do not think we understand each other well :-/

If we want to give a personalized name and that does not correspond to any information that can be used.
Here is a fictional example (links not supported by jd2, which will not give him an intelligible name and whose (s) does not contain info):
"blablabla" ::: "www...com/5236lbfjkj2355.mp4"
"dada" ::: "www...com/kutfsssdg45745.mp4"
etc.
etc.
etc.

How to do this with a rule ?
Reply With Quote
  #19  
Old 02.12.2017, 12:30
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,611
Default

same as stated earlier
you will need to know the naming scheme yourself PRIOR to adding the link in the format that Jiaz mentioned and that I said earlier. If the content is not supported by JDownloader or hasn't a support file extension you can use prefix "direct**External links are only visible to Support Staff**. This will tell the JD and the DirectHTTP plugin that the content is direct downloadable...

raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #20  
Old 02.12.2017, 20:37
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Thank you for the info of the direct link i will try it for some cases.
But here, as i said, there is no schema since the names are specified case by case.
That's why i propose to create a special file containing the names that must be assigned to the files found.
This is even more for when the links are not supported by jd2 and therefore without a real name ;-)
Reply With Quote
  #21  
Old 02.12.2017, 23:59
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,611
Default

I give up, going in circles.

JD already supports the feature you want, you need to format it yourself before (as stated numerous times) adding the link to clipboard or JD via other means (apis). It will adopt the filename you want via that means. Do this via external program or manually yourself.

thread closed

raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #22  
Old 04.12.2017, 15:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Quote:
Originally Posted by Mistery View Post
Thank you for the info of the direct link i will try it for some cases.
But here, as i said, there is no schema since the names are specified case by case.
That's why i propose to create a special file containing the names that must be assigned to the files found.
This is even more for when the links are not supported by jd2 and therefore without a real name ;-)
Did you even try what we suggested?
It works perfectly fine. And does exactly what you want.
You add an link in format url#name=xy and JDOwnloader will assign xy to that url.
The exact same as adding url and then assign xy via any manual provided file. In both cases you have to edit a file/provide the filenames
__________________
JD-Dev & Server-Admin
Reply With Quote
  #23  
Old 05.12.2017, 23:26
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Hello

Yes, i tried it and thank you very much, it works well

I take advantage that you reopened the topic to apologize :-/
I did not understand what you were explaining to me
Sorry for making you waste your time

Thanks again
Reply With Quote
  #24  
Old 06.12.2017, 11:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Thanks for the feedback! Please know that you can do so much more that way. You could also assign priority, different folder, packagenames ....
You did not *waste* our time when you finally got it working!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #25  
Old 06.12.2017, 21:02
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Thanks a lot :-)
Mgpai taught me a lot for that and more !
You talk about wildcards, it's actually very practical, but you also talk about priorities, how do you do with this technique ?
Reply With Quote
  #26  
Old 07.12.2017, 10:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Better tell us what you want to achieve and we answer how/if it can be done
__________________
JD-Dev & Server-Admin
Reply With Quote
  #27  
Old 07.12.2017, 15:13
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Nothing special, it's just to learn
In general I understood how to do but to manage the priority via this technical I would like to know ;-)
Reply With Quote
  #28  
Old 07.12.2017, 16:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You could add additional information in URL for example
#priority=HIGH&name=name
then you can check for sourceURLs contains #priority=HIGH
In that case you've got to update the existing rule for name parsing as well.

You can do a lot, too many to provide examples for all of them
__________________
JD-Dev & Server-Admin
Reply With Quote
  #29  
Old 07.12.2017, 21:22
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Ok thank you

No problem, I just wanted an example for this particular case ...
Is there a tutorial or a list of these cases?

Last edited by Mistery; 11.12.2017 at 17:16. Reason: add a question
Reply With Quote
  #30  
Old 23.01.2018, 04:30
Program
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Example link
Code:
https://board.jdownloader.org/Nothing.zip#name=Yeah.zip
https://board.jdownloader.org/Nothing2.zip#name=Yeah2.zip
https://board.jdownloader.org/Nothing3.zip#name=Yeah3.zip
instead of
Code:
Yeah.zip:::https://board.jdownloader.org/Nothing.zip
Yeah2.zip:::https://board.jdownloader.org/Nothing2.zip
Yeah3.zip:::https://board.jdownloader.org/Nothing3.zip
ALWAYS JUST ONE SINGLE RULE
Packagizer Rule
Code:
SourceURL contains
.*#name=(.+)
enable regex checkbox

then set
filename to <jd:source:1>
Dear, good!
I try here and works with one rule, i try with two, and dont works,
like this

**External links are only visible to Support Staff****External links are only visible to Support Staff**


Code:
PakageName contains
.*#pkg=()
enable regex checkbox

SourceURL contains
.*#name=(.+)
enable regex checkbox

then set
Download Directory <jd:packagename>

filename to <jd:source:1>
I try many possibilities and none works.
Anyone can help me?
Reply With Quote
  #31  
Old 23.01.2018, 13:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Works fine for me! You've got to enable the regex checkbox!
Please show screenshot of your rule
__________________
JD-Dev & Server-Admin
Reply With Quote
  #32  
Old 24.01.2018, 19:47
Program
Guest
 
Posts: n/a
Default Two rules at the same time in same link (packagename/folder and filename)

Quote:
Originally Posted by Jiaz View Post
Works fine for me! You've got to enable the regex checkbox!
Please show screenshot of your rule
Hello, thanks for the willingness to help, surely this may be the doubt of many others, I have done a lot of research and found no reference, I believe it will be a new orientation on the use of two rules of packagizer at the same time.

**External links are only visible to Support Staff****External links are only visible to Support Staff**

I want the package name be "SubjX" and the filename be "class 06 - When.mp4"

And in another link example:

**External links are only visible to Support Staff****External links are only visible to Support Staff**

I want the package name be "Auql" and the filename be "class 07 - Who.mp4"

So I try many ways use two rules at the same time in the same link, see the prints attached.


**External links are only visible to Support Staff****External links are only visible to Support Staff**

**External links are only visible to Support Staff****External links are only visible to Support Staff**

**External links are only visible to Support Staff****External links are only visible to Support Staff**

**External links are only visible to Support Staff****External links are only visible to Support Staff**

Thanks in advanced

Last edited by Program; 24.01.2018 at 20:09.
Reply With Quote
  #33  
Old 25.01.2018, 20:01
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

sourceURL contains, enable regex
Code:
.*#pkg=(.*?)#name=(.+)
__________________
JD-Dev & Server-Admin
Reply With Quote
  #34  
Old 25.01.2018, 20:37
Program
Guest
 
Posts: n/a
Default Two rules at same time works

Quote:
Originally Posted by Jiaz View Post
sourceURL contains, enable regex
Code:
.*#pkg=(.*?)#name=(.+)
Dear Jiaz,

All works ok now! Thanks!

If another users want try, just do this:
after the link put: #pkg=asdf#name=fdsa.mp4

In Jdownloader, put the suggestion of Jiaz:

Sourceurl's contains:
.*#pkg=(.*?)#name=(.+)
enable checkbox.

in ...then set package name:
<jd:source:1>

in ...then set Filename:
<jd:source:2>
Reply With Quote
  #35  
Old 26.01.2018, 09:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You're welcome!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #36  
Old 15.04.2018, 22:33
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Hello

i have a little problem:
if i scan this, example url **External links are only visible to Support Staff****External links are only visible to Support Staff** work fine
but if i scan (with name rule...) **External links are only visible to Support Staff****External links are only visible to Support Staff** don't work

Can you help me please ?
Reply With Quote
  #37  
Old 16.04.2018, 15:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

will be fixed with next update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #38  
Old 16.04.2018, 17:16
Mistery Mistery is offline
JD VIP
 
Join Date: Aug 2015
Posts: 344
Default

Thank you !
Reply With Quote
  #39  
Old 16.04.2018, 17:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #40  
Old 15.01.2021, 13:22
SMS SMS is offline
Mega Loader
 
Join Date: Jun 2019
Posts: 64
Default

Quote:
Originally Posted by Jiaz View Post
Example link
Code:
https://board.jdownloader.org/Nothing.zip#name=Yeah.zip
https://board.jdownloader.org/Nothing2.zip#name=Yeah2.zip
https://board.jdownloader.org/Nothing3.zip#name=Yeah3.zip
instead of
Code:
Yeah.zip:::https://board.jdownloader.org/Nothing.zip
Yeah2.zip:::https://board.jdownloader.org/Nothing2.zip
Yeah3.zip:::https://board.jdownloader.org/Nothing3.zip
ALWAYS JUST ONE SINGLE RULE
Packagizer Rule
Code:
SourceURL contains
.*#name=(.+)
enable regex checkbox

then set
filename to <jd:source:1>
This Packagizer Rule has the following inconsistent behavior:

With #name=A 'B, C.jpg, the file is renamed to A 'B, C.jpg
With #name=A 'B', C.jpg, the file is renamed to A 'B
i.e. it cuts off the file name when `'` is followed by `)` or `,` and a space but not by `B`.

Many files that I want to download are affected. How can this be fixed? A complete solution would be great, without having to tediously analyze by trial and error which other character combinations apart from `', ` and `') ` are problematic.

Edit: Same problem when the file names are like that on the server (without renaming via the Packagizer Rule). For example:
**External links are only visible to Support Staff****External links are only visible to Support Staff** 'B, C.jpg is grabbed as A 'B, C.jpg
**External links are only visible to Support Staff****External links are only visible to Support Staff** 'B', C.jpg is grabbed as A 'B

Last edited by SMS; 15.01.2021 at 13:40.
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 20:40.
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.