GithubHelp home page GithubHelp logo

shichao-an / 115wangpan Goto Github PK

View Code? Open in Web Editor NEW
109.0 109.0 25.0 1.39 MB

(Deprecated) Unofficial Python API wrapper SDK for 115.com (115网盘)

Home Page: http://115wangpan.rtfd.org

License: BSD 2-Clause "Simplified" License

Python 99.93% Shell 0.07%

115wangpan's People

Contributors

binbibi avatar johnnywsd avatar pandazxx avatar shichao-an avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

115wangpan's Issues

Failed to get download URL

f = files[0]
f.url
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/site-packages/u115/api.py", line 1240, in url
return self.get_download_url()
File "/usr/lib/python2.6/site-packages/u115/api.py", line 1234, in get_download_url
self.api._req_files_download_url(self.pickcode, proapi)
File "/usr/lib/python2.6/site-packages/u115/api.py", line 886, in _req_files_download_url
raise RequestFailure('Failed to get download URL.')
u115.api.RequestFailure: Failed to get download URL.

Can't support this cookie file from curl command

➜ ~ cat /tmp/aa.cookie
screenshot_2015-04-15_20-13-10

File locate at
http://pan.baidu.com/s/1jGzO90a

This file come from this command.
➜ ~ rm /tmp/aa.cookie && curl 'http://passport.115.com/?ct=open_login&ac=api_login&t=qq&goto=&code=9AD253F2306CB0BC33D464C372928724' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' -H 'Accept-Language: zh-CN,en-US;q=0.7,en;q=0.3' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Host: passport.115.com' -H 'Referer: http://openapi.qzone.qq.com/oauth/show?which=ConfirmPage&display=pc&redirect_uri=http%3A%2F%2Fpassport.115.com%2F%3Fct%3Dopen_login%26ac%3Dapi_login%26t%3Dqq%26goto%3D&response_type=code&oauth_token=&client_id=100229269' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0' -c /tmp/aa.cookie -b PHPSESSID=bo72eikeo6ijn9oibul0na5mn0 > /dev/null && cat /tmp/aa.cookie

I use these commands to load.

from u115 import API
api = API(auto_logout=False,persistent=True,cookies_filename='/tmp/aa.cookie',cookies_type='MozillaCookieJar')
api.cookies
str(api.cookies).count('=')

Only load three cookie name,It ignore the row which contain string "#HttpOnly_.115.com".

My python version
Python 3.4.3

Sorry for my english.

After an "exceeding the max tasks amount" error, keeps receiving "Torrent upload failed. Please try again later."

I 'm a VIP of 115. When I do add_task_bt() continuously and there 're too many tasks(say 20 concurrent tasks), then I receive an error saying "超出最大任务数量"(exceeding the max allowed tasks amount), which is the expected behaviour.

So I sleep(30) and try to add_task_bt() again, expecting to either successfully add the task, or receive another same error. However, I then keeps getting "Torrent upload failed, Please try again later" error, and even after several minutes some of the tasks in the queue is finished(so there 's space for a new task), I keeps seeing this error.

Restarting my program and relogin(), and I can add_task_bt() smoothly.

the speed is too slow

I logined in with a VIP 115 account,and I get the download URL with this API ,but the download speed is too slow

多wan下只能单wan的速度

用115浏览器下载,在多wan环境下有叠加效果,是否因为支持多线程下载的关系,搞不懂,望指教。
python是否也可以支持?

如何可以返回全部task

def _req_lixian_task_lists(self, page=1):
    """
    This request will cause the system to create a default downloads
    directory if it does not exist
    """
    url = 'http://115.com/lixian/'
    params = {'ct': 'lixian', 'ac': 'task_lists'}
    self._load_signatures()
    data = {
        'page': page,
        'uid': self.user_id,
        'sign': self._signatures['offline_space'],
        'time': self._lixian_timestamp,
    }
    req = Request(method='POST', url=url, params=params, data=data)
    res = self.http.send(req)

你好, 请教一下, 每次我调用这里的时候, res都只会返回4个任务, 但是我在浏览器登陆115是有很多任务的,没有返回全部?

Rename "auto_resume" argument name and add "auto_retry"

Rename auto_resume optional argument name to resume, which makes more sense;
Add auto_retry optional argument which automatically retries on unfinished close transfer, typically indicated by errors like "pycurl.error: (18, 'transfer closed with 1949848720 bytes remaining to read')".

Add isatty() to progress stream

Add and check isatty() to progress stream so when the program is not connected to the terminal, it will output like logs (one progress per line ending \n instead of \r).

Task类的list()函数问题

def list(self, count=30, order='user_ptime', asc=False, show_dir=True,
         natsort=True):
    return self.directory.list(count, order, asc, show_dir, natsort)

提交离线任务后,如果该TASK是单一文件,没有目录的时候报错。好像是这个功能点还没实现吧?

Adding download feature

Due to session constraints, download feature can be added where the current session is associated. iter_content method of the Response object from requests library can be used, and an ideal chunk_size should be determined based on the file to be downloaded

上传东西报错

谢谢你写的这个代码,今天用这个代码上传东西的时候报错,下面是我的代码:
import u115

api = u115.API()

api.login('usename', 'password')

u = api.upload('/root/sh/115/115_cookies.txt')

报下面的错误:
Traceback (most recent call last):
File "../115/115.py", line 10, in
u = api.upload('/root/sh/115/115_cookies.txt')
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 306, in upload
directory = self.downloads_directory
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 214, in downloads_directory
self._load_lixian_space()
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 618, in _load_lixian_space
self._torrents_directory = self._load_directory(torrent_cid)
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 608, in _load_directory
kwargs = self._req_directory(cid)
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 511, in _req_directory
raise RequestFailure('No directory found.')
u115.api.RequestFailure: No directory found.

不知道怎么回事?还有请问在用api.upload 函数上传文件的时候,后面的directory 要怎么写,比如我要上传文件到movie文件夹,directory要怎么写?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.