#1
|
|||
|
|||
vk.com documents
I'm having some issues with some (but not all vk documents).
example links that don't work: **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** document links that do work: **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** the difference seems to be that the links that don't work have a redirect request (302) to get to the document. no need for a vk account, all 7 links are accessible with direct http. |
#2
|
|||
|
|||
I had a few minutes to spare and I found the problem but I would rather have someone that is good with regular expression make the change him/herself.
First, the problem is in VKontakteRuHoster. After getting a redirect (line 190), you can either get a TYPE_DOCLINK link (vk.com/doc) or a TYPE_DIRECT link (userapi.com/whatever) as shown in the code below: VKontakteRuHoster:line 190: Code:
if (br.getRedirectLocation() != null) { if (br.getRedirectLocation().matches(VKontakteRuHoster.TYPE_DOCLINK)) { /*not relevant*/ } else if (br.getRedirectLocation().matches(VKontakteRuHoster.TYPE_DIRECT)) { /*not relevant*/ } Quote:
I tried to add an mp4, a csproj and a python (.py) file to my "documents section" in my own account and they all worked. I think the reality is that you can get any file type after a redirect and the TYPE_DIRECT regex should allow for any file type. Suggested fix would be something like this? private static final String TYPE_DIRECT = "https?://(?:c|p)s[a-z0-9\\-]+\\.(?:vk\\.com|userapi\\.com|vk\\.me)/[^<>"]+\\.(?:[A-Za-z0-9]{1,5})(?:.*)"; I suck too bad at regular expression to make the change myself. I tried the proposed change on my own JD build and it looks like it works well. The problem to testing is that it's hard finding document links that generate a redirect. General thoughts I had about contributing directly to the project you may want to consider (i'm hoping raz, jiaz or another big head will read this and maybe think about it):
Last edited by botmtl; 12.10.2017 at 08:59. |
#3
|
||||
|
||||
I've updated the pattern as suggested by you.
If you wish to contribute and modify code yourself, just contact us via support@jdownloader.org. There are advantages and disadvantages of svn vs git. At the moment there are no plans to change to git because our complete build/deployment system is build on svn + git doesnt support (as far as I know) permissions/hidden folders and such stuff.
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 12.10.2017 at 12:41. |
Thread Tools | |
Display Modes | |
|
|