JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 16.04.2020, 04:46
Jens Jens is offline
Modem User
 
Join Date: Nov 2018
Posts: 2
Default Hilfe beim Dateiumbenennungen mittels RegExp im Paketverwalter

Hallo zusammen,

ich nutze für einige wiederkehrende Downloads den Paketverwalter um Einstellungen automatisch anzupassen. An einigen Stellen stoße ich dabei jedoch auf Probleme; insbesondere bei regulären Ausdrücken.

Dateinamen enthalten in vielen dieser Fälle Datumsangaben und nicht immer sind diese im gewünschten Format: z.B. archive-09-03-2020.part1.rar. Diese erfasse ich mit dem Feld Dateiname [ist gleich] "archive-[0-9]{2}-[0-9]{2}-[0-9]{4}.part[0-9]{1}.rar", jedoch würde ich den Dateinamen gerne ändern, so dass DD-MM-YYYY zu YYYY-MM-DD wird. Gibt es dafür auch ein regulären Ausdruck, mit dem ich die variablen Teile aus dem Bedingungs-RegExp wiederverwenden kann? Wie müsste der reguläre Ausdruck im obigen Fall aussehen?

Außerdem fände ich es gut, wenn der Paketverwalter nicht grundsätzlich ein neues Paket erstellen würde, sondern, sofern ein gleichnamiges Paket bereits existiert, die neuen Downloads in das bestehende Paket einfügt. Kann ich das auch irgendwie erreichen?

Viele Grüße
Jens
Reply With Quote
  #2  
Old 16.04.2020, 12:25
oEFLKQzikCqw oEFLKQzikCqw is offline
JD Legend
 
Join Date: Mar 2012
Posts: 1,780
Default

Quote:
Originally Posted by Jens View Post
Außerdem fände ich es gut, wenn der Paketverwalter nicht grundsätzlich ein neues Paket erstellen würde, sondern, sofern ein gleichnamiges Paket bereits existiert, die neuen Downloads in das bestehende Paket einfügt. Kann ich das auch irgendwie erreichen?
Das hat nichts mit dem Paketverwalter zu tun. Das passiert bei der Übernahme der Downloads in die Downloadliste. Im Linksammler landet bei gleichem Paketnamen alles in einem Paket.
Reply With Quote
  #3  
Old 16.04.2020, 12:59
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,659
Default

also depends on how you add links,
a) addlinks dialog/my.jd does this set packagename?
b) does url trigger decrypter plugin which sets packagename
c) if not the above its derived from filename

b) and c) you can rename via package customiser without problems. a) will depend on checkbox setting to bypass package customiser or not.

each time a package is created by decrypter plugin it doesn't allow merging by default. so each goes into its own package.

in respects to regex pattern
(.*-)(\d{1,2})-(\d{1,2})-(\d{2}|\d{4})(.+)
<jd:orgfilename:1><jd:orgfilename:4>-<jd:orgfilename:3>-<jd:orgfilename:2><jd:orgfilename:5>
something like that
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #4  
Old 17.04.2020, 03:07
Jens Jens is offline
Modem User
 
Join Date: Nov 2018
Posts: 2
Default

Quote:
Originally Posted by oEFLKQzikCqw View Post
Das hat nichts mit dem Paketverwalter zu tun. Das passiert bei der Übernahme der Downloads in die Downloadliste. Im Linksammler landet bei gleichem Paketnamen alles in einem Paket.
Danke Dir, das war auch meine Beobachtung, aber da JD2 so viele Profieinstellungen hat, könnte es gut sein, dass es da eine passende Option gibt, die ich noch nicht gefunden hab

Quote:
Originally Posted by raztoki View Post
also depends on how you add links,
a) addlinks dialog/my.jd does this set packagename?
b) does url trigger decrypter plugin which sets packagename
c) if not the above its derived from filename

b) and c) you can rename via package customiser without problems. a) will depend on checkbox setting to bypass package customiser or not.

each time a package is created by decrypter plugin it doesn't allow merging by default. so each goes into its own package.
I usually use click-n-load or copy&paste (if cnl fails). In the case I asked about, it's cnl into the link collector where the package customiser grabs those links (using the regexp we are talking about) and changes the package name to one which is always the same. So for each week I got 2-3 packages of the same name in the downloadlist and put them together manually. Therefore I was looking for a way to automatise this as well.

Quote:
Originally Posted by raztoki View Post
in respects to regex pattern
(.*-)(\d{1,2})-(\d{1,2})-(\d{2}|\d{4})(.+)
<jd:orgfilename:1><jd:orgfilename:4>-<jd:orgfilename:3>-<jd:orgfilename:2><jd:orgfilename:5>
something like that
Thanks for the example, it works like a charm! I needed to "translate" the pattern (using wikipedia and autoit .de /onlinehilfe/online/html/functions/StringRegExp.htm), because I am not very used to regexp and find those used in my first post more easy to understand. FYI my patterns are:
  1. (archive)-([0-9]{2})-([0-9]{2})-([0-9]{4})(.part[0-9]{1}.rar)
  2. <jd:orgfilename:1> <jd:orgfilename:4>-<jd:orgfilename:3>-<jd:orgfilename:2><jd:orgfilename:5>

PS Sorry for my bad english, I hope I could understand you right and vice versa...

Last edited by Jens; 17.04.2020 at 03:21.
Reply With Quote
  #5  
Old 17.04.2020, 11:59
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,143
Default

Hi Jens,

wenn es ums Ausprobieren/lernen von RegEx geht empfehle ich folgendes Webtool: regex101.com
(Hilft dir bei Paketverwalter-Regeln mit unseren Tags natürlich nichts, aber Tags != RegEx)

Grüße, 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
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 14:03.
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.