JDownloader Community - Appwork GmbH
 

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 21.01.2024, 20:12
Student im ersten Jahr Student im ersten Jahr is offline
Black Hole
 
Join Date: Nov 2020
Posts: 291
Default Problem detect correct "filename" direct link

Problem detect correct "filename" direct link. How to fix this problem? :(

**External links are only visible to Support Staff****External links are only visible to Support Staff**
  #2  
Old 22.01.2024, 22:54
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,669
Default

you will need to create a package customiser rule for it
something like source url: 52mix\.cn/.+\?(.*) [with regex] && filename <jd:source:1>
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
  #3  
Old 23.01.2024, 15:39
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,746
Default

I may add that this is not a bug.
You will get the same default filename when you download that item manually via browser.
__________________
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?
  #4  
Old 24.01.2024, 20:13
Student im ersten Jahr Student im ersten Jahr is offline
Black Hole
 
Join Date: Nov 2020
Posts: 291
Default

Quote:
Originally Posted by raztoki View Post
you will need to create a package customiser rule for it
something like source url: 52mix\.cn/.+\?(.*) [with regex] && filename <jd:source:1>
Regex Match matches in JD2(Java?) Regex Engine for these links?
**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**

Boost.Regex Engine
Code:
https:\/\/www\.52mix\.cn\/wp-content\/uploads\/audition\/\d+\/\d+\/\d+\/\d+_\d+\.mp3

Last edited by raztoki; 25.01.2024 at 08:59. Reason: forum backend truncated links
  #5  
Old 25.01.2024, 09:05
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,669
Default

Do not use boost regex engine, a quick google (wasn't sure what it was) its for c plus plus from what I can gather. You need to use the Java interpreter in what ever website you're testing inside. I do recommend regex101 as it has a Java8 flavour and has a easy to use interface.
The pattern I provided should work as is, I just re-checked those links and yes works fine.

Btw you do not need to escape slashes / in Java.

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

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

Last edited by raztoki; 25.01.2024 at 09:08.
  #6  
Old 25.01.2024, 10:48
Student im ersten Jahr Student im ersten Jahr is offline
Black Hole
 
Join Date: Nov 2020
Posts: 291
Default

That's right. In Java, it is necessary to double-protect the \\ character, so we use \\ in the regex instead of a single \\. If we use this regular expression in Java code

String regex = "**External links are only visible to Support Staff**;
This regular expression will match URLs that start with "**External links are only visible to Support Staff** and contain at least one character after that fragment, followed by a question mark and anything after that. The group with dots (.+) means "match any character (except newline) at least once."
  #7  
Old 25.01.2024, 11:13
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,746
Default

Thread closed.
__________________
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?
  #8  
Old 26.01.2024, 00:44
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,669
Default

package customiser is standard regex, it does not need to be 'double' escaped, like it does inside Java code. Use the pattern I gave, check the checkbox for regex and it should work.

since the url is picked up due to directhttp plugin, its based on protocol and file extension, in this case **External links are only visible to Support Staff** the package customer rule does not need entire url structure or a pattern for the full url structure to work. The working example I gave is all you need to find the info you're looking for

and yes this thread is solved and closed.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

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

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 01:01.
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.