@@ -0,0 +1,2707 @@
+%EF%BB%BF# -*- coding: utf-8 -*-%0A%22%22%22%0A    This program is free software; you can redistribute it and/or modify%0A    it under the terms of the GNU General Public License as published by%0A    the Free Software Foundation; either version 3 of the License,%0A    or (at your option) any later version.%0A%0A    This program is distributed in the hope that it will be useful,%0A    but WITHOUT ANY WARRANTY; without even the implied warranty of%0A    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.%0A    See the GNU General Public License for more details.%0A%0A    You should have received a copy of the GNU General Public License%0A    along with this program; if not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%0A    @author: halfman%0A%22%22%22%0A%0Aimport re%0Afrom module.plugins.Hoster import Hoster%0Afrom module.network.RequestFactory import getURL%0A%0Adef getInfo(urls):%0A    result = %5B%5D%0A%0A    for url in urls:%0A%0A        html = getURL(url, decode=True)%0A        if re.search(LoadTo.FILE_OFFLINE_PATTERN, html):%0A            # File offline%0A            result.append((url, 0, 1, url))%0A        else:%0A            # Get file info%0A            name = re.search(LoadTo.FILE_NAME_PATTERN, html)%0A            size = re.search(LoadTo.SIZE_PATTERN, html)%0A            if name is not None:%0A                name = name.group(1)%0A                size = size.group(1)%0A                result.append((name, size, 2, url))%0A    yield result%0A%0Aclass LoadTo(Hoster):%0A    __name__ = %22LoadTo%22%0A    __type__ = %22hoster%22%0A    __pattern__ = r%22http://.*load.to/.*%22%0A    __version__ = %220.1%22%0A    __description__ = %22%22%22load.to%22%22%22%0A    __author_name__ = (%22halfman%22)%0A    __author_mail__ = (%22Pulpan3@gmail.com%22)%0A%0A    FILE_NAME_PATTERN = r'%3Cdiv class=%22toolarge%22%3E%3Ch1%3E(%5B%5E%3C%5D+)%3C/h1%3E%3C/div%3E'%0A    URL_PATTERN = r'%3Cform method=%22post%22 action=%22(%5B%5E%22%5D+)%22'%0A    SIZE_PATTERN = r'%3Cdiv class=%22download_table_right%22%3E(%5Cd+) Bytes%3C/div%3E'%0A    FILE_OFFLINE_PATTERN = r'Can%5C't find file. Please check URL.%3Cbr /%3E'%0A    WAIT_PATTERN = r'type=%22submit%22 value=%22Download %5C((%5Cd+)%5C)%22'%0A%0A    def setup(self):%0A        self.multiDL = False%0A%0A    def process(self, pyfile):%0A%0A        self.html = self.load(pyfile.url, decode=True)%0A%0A        if re.search(self.FILE_OFFLINE_PATTERN, self.html):%0A            self.offline()%0A        %0A        timmy = re.search(self.WAIT_PATTERN, self.html)%0A        if timmy:%0A            self.setWait(timmy.group(1), True)%0A            self.wait()%0A%0A        found = re.search(self.FILE_NAME_PATTERN, self.html)%0A        if found is None:%0A            self.fail(%22Parse error (NAME)%22)%0A        pyfile.name = found.group(1)%0A%0A        found = re.search(self.URL_PATTERN, self.html)%0A        if found is None:%0A            self.fail(%22Parse error (URL)%22)%0A        download_url = found.group(1)%0A%0A        self.download(download_url)

add hoster load.to