#1
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
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 |
#4
|
|||
|
|||
Quote:
**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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
Thread closed.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#8
|
||||
|
||||
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. :] |
Thread Tools | |
Display Modes | |
|
|