JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 12.02.2019, 12:44
vipony12 vipony12 is offline
Baby Loader
 
Join Date: Dec 2018
Posts: 5
Default kenfiles.com out of date

The plugin error, please update

12.02.19 19.02.03 <--> 12.02.19 19.03.08 jdlog://4948576935451/

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

Last edited by Jiaz; 12.02.2019 at 13:10.
Reply With Quote
  #2  
Old 12.02.2019, 13:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 03.03.2019, 05:18
vipony12 vipony12 is offline
Baby Loader
 
Join Date: Dec 2018
Posts: 5
Default

After long time wait fix, i try fix it with SVN
Now the plugin working with new version
So, can you help me update on jdownloader

This is new code of plugin: KenfilesCom.java
Spoiler:

The new version may be not good, but working fine
Code:
//jDownloader - Downloadmanager
//Copyright (C) 2013  JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;

import java.util.regex.Pattern;

import org.jdownloader.plugins.components.XFileSharingProBasic;

import jd.PluginWrapper;
import jd.parser.Regex;
import jd.plugins.Account;
import jd.plugins.Account.AccountType;
import jd.plugins.DownloadLink;
import jd.plugins.HostPlugin;

@HostPlugin(revision = "$Revision: 40438 $", interfaceVersion = 3, names = {}, urls = {})
public class KenfilesCom extends XFileSharingProBasic {
    public KenfilesCom(final PluginWrapper wrapper) {
        super(wrapper);
        this.enablePremium(super.getPurchasePremiumURL());
    }

    /**
     * DEV NOTES XfileSharingProBasic Version SEE SUPER-CLASS<br />
     * mods: See overridden functions<br />
     * limit-info:2019-03-01: premium untested, set FREE account limits <br />
     * captchatype-info: 2019-03-01: reCaptchaV2<br />
     * other:<br />
     */
    private static String[] domains = new String[] { "kenfiles.com", "kfs.space" };

    @Override
    public boolean isResumeable(final DownloadLink link, final Account account) {
        if (account != null && account.getType() == AccountType.FREE) {
            /* Free Account */
            return false;
        } else if (account != null && account.getType() == AccountType.PREMIUM) {
            /* Premium account */
            return true;
        } else {
            /* Free(anonymous) and unknown account type */
            return false;
        }
    }

    @Override
    public int getMaxChunks(final Account account) {
        if (account != null && account.getType() == AccountType.FREE) {
            /* Free Account */
            return 1;
        } else if (account != null && account.getType() == AccountType.PREMIUM) {
            /* Premium account */
            return -2;
        } else {
            /* Free(anonymous) and unknown account type */
            return 1;
        }
    }

    @Override
    public int getMaxSimultaneousFreeAnonymousDownloads() {
        return 1;
    }

    @Override
    public int getMaxSimultaneousFreeAccountDownloads() {
        return 1;
    }

    @Override
    public int getMaxSimultanPremiumDownloadNum() {
        return -1;
    }

    @Override
    public boolean supports_https() {
        return true;
    }

    @Override
    public boolean supports_precise_expire_date() {
        return super.supports_precise_expire_date();
    }

    @Override
    public boolean isAudiohoster() {
        return super.isAudiohoster();
    }

    @Override
    public boolean isVideohoster() {
        return super.isVideohoster();
    }

    @Override
    public boolean isVideohoster_2() {
        return super.isVideohoster_2();
    }

    @Override
    public boolean isVideohoster_enforce_video_filename() {
        return super.isVideohoster_enforce_video_filename();
    }

    @Override
    public boolean isImagehoster() {
        return super.isImagehoster();
    }

    @Override
    public boolean supports_availablecheck_alt() {
        return super.supports_availablecheck_alt();
    }

    @Override
    public boolean supports_availablecheck_filesize_alt_fast() {
        return super.supports_availablecheck_filesize_alt_fast();
    }

    @Override
    public boolean prefer_availablecheck_filesize_alt_type_old() {
        return super.prefer_availablecheck_filesize_alt_type_old();
    }

    @Override
    public boolean supports_availablecheck_filename_abuse() {
        return super.supports_availablecheck_filename_abuse();
    }

    @Override
    public boolean supports_availablecheck_filesize_html() {
        return super.supports_availablecheck_filesize_html();
    }

    @Override
    public boolean requires_WWW() {
        return super.requires_WWW();
    }

    public static String[] getAnnotationNames() {
        return new String[] { domains[0] };
    }

    @Override
    public String[] siteSupportedNames() {
        return domains;
    }

    /**
     * returns the annotation pattern array: 'https?://(?:www\\.)?(?:domain1|domain2)/(?:embed\\-)?[a-z0-9]{12}'
     *
     */
    public static String[] getAnnotationUrls() {
        // construct pattern
        final String host = getHostsPattern();
        return new String[] { host + "/(?:embed\\-)?[a-z0-9]{12}(?:/[^/]+\\.html)?" };
    }

    /** returns 'https?://(?:www\\.)?(?:domain1|domain2)' */
    private static String getHostsPattern() {
        final String hosts = "https?://(?:www\\.)?" + "(?:" + getHostsPatternPart() + ")";
        return hosts;
    }

    /** Returns '(?:domain1|domain2)' */
    public static String getHostsPatternPart() {
        final StringBuilder pattern = new StringBuilder();
        for (final String name : domains) {
            pattern.append((pattern.length() > 0 ? "|" : "") + Pattern.quote(name));
        }
        return pattern.toString();
    }

    /** Function to find the final downloadlink. */
    @Override
    public String getDllink() {
        String dllink = br.getRedirectLocation();
        if (dllink == null) {
            dllink = new Regex(correctedBR, "(\"|\\')(https?://(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|([\\w\\-]+\\.)?kfs\\.space)(:\\d{1,4})?/(files|d|p|f|cgi\\-bin/dl\\.cgi)/(\\d+/)?[a-z0-9]+/[^<>\"/]*?)(\"|\\')").getMatch(1);
            if (dllink == null) {
                final String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
                if (cryptedScripts != null && cryptedScripts.length != 0) {
                    for (String crypted : cryptedScripts) {
                        dllink = decodeDownloadLink(crypted);
                        if (dllink != null) {
                            break;
                        }
                    }
                }
            }
        }
        return dllink;
    }

    @Override
    public String decodeDownloadLink(final String s) {
        String decoded = null;
        try {
            Regex params = new Regex(s, "'(.*?[^\\\\])',(\\d+),(\\d+),'(.*?)'");
            String p = params.getMatch(0).replaceAll("\\\\", "");
            int a = Integer.parseInt(params.getMatch(1));
            int c = Integer.parseInt(params.getMatch(2));
            String[] k = params.getMatch(3).split("\\|");
            while (c != 0) {
                c--;
                if (k[c].length() != 0) {
                    p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
                }
            }
            decoded = p;
        } catch (Exception e) {
        }
        String finallink = null;
        if (decoded != null) {
            /* Open regex is possible because in the unpacked JS there are usually only 1-2 URLs. */
            finallink = new Regex(decoded, "(?:\"|')(https?://[^<>\"']*?\\.(avi|flv|mkv|mp4))(?:\"|')").getMatch(0);
            if (finallink == null) {
                /* Maybe rtmp */
                finallink = new Regex(decoded, "(?:\"|')(rtmp://[^<>\"']*?mp4:[^<>\"']+)(?:\"|')").getMatch(0);
            }
        }
        return finallink;
    }
}
Reply With Quote
  #4  
Old 03.03.2019, 11:11
tony2long's Avatar
tony2long tony2long is offline
English Supporter
 
Join Date: Jun 2009
Posts: 6,193
Default

Could you please create the patch?
__________________
FAQ: How to upload a Log
Reply With Quote
  #5  
Old 04.03.2019, 02:56
vipony12 vipony12 is offline
Baby Loader
 
Join Date: Dec 2018
Posts: 5
Default

Quote:
Originally Posted by tony2long View Post
Could you please create the patch?
I attacted the patch file!
Attached Files
File Type: zip KenfileCom.java.patch.zip (13.8 KB, 1 views)
Reply With Quote
  #6  
Old 04.03.2019, 14:01
tony2long's Avatar
tony2long tony2long is offline
English Supporter
 
Join Date: Jun 2009
Posts: 6,193
Default

Thanks, but sorry, it's a big change, better wait for psp.
Or you can contact Jiaz (support@jdownloader.org) asking for write access to svn so maybe you can help solving other problems as well.
__________________
FAQ: How to upload a Log
Reply With Quote
  #7  
Old 04.03.2019, 14:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

@vipony12: If you want we can grant you write access to repo so you can commit the change by yourself Just contact me ( support@jdownloader.org ) for details
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 04.03.2019, 15:35
vipony12 vipony12 is offline
Baby Loader
 
Join Date: Dec 2018
Posts: 5
Default

Quote:
Originally Posted by tony2long View Post
Thanks, but sorry, it's a big change, better wait for psp.
Or you can contact Jiaz (support@jdownloader.org) asking for write access to svn so maybe you can help solving other problems as well.
Thanks

Quote:
Originally Posted by Jiaz
@vipony12: If you want we can grant you write access to repo so you can commit the change by yourself Just contact me ( support@jdownloader.org ) for details
Thanks, I contacted
Reply With Quote
  #9  
Old 04.03.2019, 16:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

I've already replied
__________________
JD-Dev & Server-Admin
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 21:39.
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 - 2019, Jelsoft Enterprises Ltd.