<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import re
import tempfile
from time import time
from time import sleep

from Plugin import Plugin

class NetloadIn(Plugin):

    def __init__(self, parent):
        Plugin.__init__(self, parent)
        props = {}
        props['name'] = "NetloadIn"
        props['type'] = "hoster"
        props['pattern'] = r"http://.*netload\.in/"
        props['version'] = "0.1"
        props['description'] = """Netload.in Download Plugin"""
        props['author_name'] = ("spoob", "RaNaN")
        props['author_mail'] = ("<EMAIL>")
        self.props = props
        self.parent = parent
        self.html = [None, None, None]
        self.want_reconnect = False
        self.init_ocr()

    def prepare(self, thread):
        pyfile = self.parent

        self.want_reconnect = False

        tries = 0

        while not pyfile.status.url:

            self.req.clear_cookies()
            self.download_html()

            pyfile.status.exists = self.file_exists()

            if not pyfile.status.exists:
                raise Exception, "The file was not found on the server."

            pyfile.status.filename = self.get_file_name()

            self.download_html2()

            self.get_wait_time()

            pyfile.status.waituntil = self.time_plus_wait
            pyfile.status.want_reconnect = self.want_reconnect
<commit_msg>fixed #31<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import re
import tempfile
from time import time
from time import sleep

from Plugin import Plugin

class NetloadIn(Plugin):

    def __init__(self, parent):
        Plugin.__init__(self, parent)
        props = {}
        props['name'] = "NetloadIn"
        props['type'] = "hoster"
        props['pattern'] = r"http://.*netload\.in/"
        props['version'] = "0.1"
        props['description'] = """Netload.in Download Plugin"""
        props['author_name'] = ("spoob", "RaNaN")
        props['author_mail'] = ("<EMAIL>")
        self.props = props
        self.parent = parent
        self.html = [None, None, None]
        self.want_reconnect = False
        self.multi_dl = False
        self.init_ocr()

    def prepare(self, thread):
        pyfile = self.parent

        self.want_reconnect = False

        tries = 0

        while not pyfile.status.url:

            self.req.clear_cookies()
            self.download_html()

            pyfile.status.exists = self.file_exists()

            if not pyfile.status.exists:
                raise Exception, "The file was not found on the server."

            pyfile.status.filename = self.get_file_name()

            self.download_html2()

            self.get_wait_time()

            pyfile.status.waituntil = self.time_plus_wait
            pyfile.status.want_reconnect = self.want_reconnect

{'fraction_non_alphanumeric': 0.12052002810962754, 'fraction_numerical': 0.004216444132115249, 'mean_word_length': 2.081168831168831, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '635987', 'n_tokens_mistral': 865, 'n_tokens_neox': 825, 'n_words': 193}