JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 16.04.2024, 19:38
snkrt0925 snkrt0925 is offline
Modem User
 
Join Date: Dec 2023
Posts: 1
Post Packagizer Access To DeviantArt FileID

Hello,

I might be missing something else here, but the DeviantArt plugin does not allow the packagizer to see the "file id". This is not in the url of the content itself, but in the url of the link to the post. Pulling a random picture of a chair from the front page, we get the post url:

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

Where "1042710321" is the File ID. In that example post, the plugin creates the filename as "[title] by [artist]_[file id]", so without any custom rules you'd get "Chair by Thirstyrover_1042710321" in the packagizer.

I was trying to make a packagizer rule that would rename these so they're stored in order posted by starting with either the post date (wasn't available either) or the file id (these seem globally sequential to the site so that should do the same thing) and since metadata accessible via jd:prop isn't really documented I dug around the forums for a bit only to come up dry. Without getting the IDE set up, I found a **External links are only visible to Support Staff**source code mirror of the plugin last updated last year and did some poking around.

I've never written a single line of Java so I apologize for any misinterpretation, but from testing it looks like the only properties available to the packagizer are those that are both declared(?) as public and with names that start with "PROPERTY_" (lines 76-78 in the source link), so we get "username", "title", and "type".

Guessing that the plugin is what inserts the "by", a quick search of the code brings us to line 339 where the plugin forms the filename:
Code:
title += " by " + username + "_ " + fid;
In that line we see its the "fid" string variable that contains exactly what I'm looking for, and is what cannot be accessed by the packagizer (tried jd:prop:fid,:fileid,etc).

I'm absolutely unqualified to be making this suggestion, but it seems like adding:
Code:
public static final String         PROPERTY_FILEID                         = "fid";
to the declarations would allow users to make packagizer rules using "<jd:prop:fileid>", so in the case of that example,

"<jd:prop:fileid>-<jd:prop:title>.<jd:prop:orgfiletype>"

would allow the packagizer to rename "Chair by Thirstyrover_1042710321.jpg" to "1042710321-Chair.jpg".

Alternatively, is there some nested element in some other variable that is accessible with this data?

Thanks
Reply With Quote
  #2  
Old 17.04.2024, 12:17
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,331
Default

Hi,

Quote:
Originally Posted by snkrt0925 View Post
I might be missing something else here, but the DeviantArt plugin does not allow the packagizer to see the "file id".
This plugin does not store the fileID as a separate property.
Sure I could add this but it's not necessary in this case.You can just use the Packagizer to extract it from the source-URL and then set it as filename.
Screenshot:

Rule as text:
Sourceurl -> Contains -> ([0-9]+)$ --> Enable regex checkbox on right side
...then set
Filename: <jd:source:1>.<jd:orgfiletype>


Quote:
Originally Posted by snkrt0925 View Post
the post date (wasn't available either)
Feel free to ask us to add it as a property.

Quote:
Originally Posted by snkrt0925 View Post
jd:prop isn't really documented
No this is not how it works.
All you need to know is documented here:
https://support.jdownloader.org/de/k...the-packagizer

Quote:
Originally Posted by snkrt0925 View Post
I found a source code mirror of the plugin last updated last year and did some poking around.
You can either get the current code via our SVN or obtain it from a current mirror such as:
github.com/mycodedoesnotcompile2/jdownloader_mirror/

Quote:
Originally Posted by snkrt0925 View Post
I've never written a single line of Java so I apologize for any misinterpretation, but from testing it looks like the only properties available to the packagizer are those that are both declared(?) as public and with names that start with "PROPERTY_" (lines 76-78 in the source link), so we get "username", "title", and "type".
Yes and no.
Everything that is set on a DownloadLink item via dlink.setProperty("nameOfProperty", "contentOfProperty") is later accessible via jd:prop:nameOfProperty.
EDIT I've just updated our Packagizer article to also contain the above information.

I'm aware to the fact that the current system has its flaws. Here is a thread where better file naming customizations are discussed:
https://board.jdownloader.org/showthread.php?t=90744
Feel free to join the discussion.
__________________
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?

Last edited by pspzockerscene; 17.04.2024 at 17:58. Reason: EDIT
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 11:29.
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.