Skip to main content

Offline 115 (115 离线下载 python 命令行工具)

author: owtotwo

可配合 extract_115_cookies_ext 项目使用

usage: offl115 [-h] [-c cookies] [-t torrent [torrent ...]] [-m magnet [magnet ...]] [--check] [-v]

115离线下载命令行工具(用于添加115离线下载任务)

optional arguments:
  -h, --help            show this help message and exit
  -c cookies, --cookies cookies
                        本地115的cookies文件路径(仅支持分号间隔的cookies字符串为文本内容)
                        若无此值,则根据环境变量`OFFLINE_115_COOKIES_PATH`查找
                        若无环境变量,则根据默认cookies路径`C:\Users\AT\.115.cookies`查找
  -t torrent [torrent ...], --torrent torrent [torrent ...]
                        本地种子文件
  -m magnet [magnet ...], --magnet magnet [magnet ...]
                        磁力链接(最多15个)
  --check               检查本地cookies是否能正常登陆115
  -v, --version         显示此命令行当前版本

Requirements

  • Windows 10
  • Python3.7+
  • pip
  • pypi
    • bencode.py == 4.0.0
    • requests == 2.24.0

Before Installation

Install extract_115_cookies_ext in 115 browser, Login and Save the 115 cookies to file 'C:\Users<You>.115.cookies'. (Make sure the prefix dot in .115.cookies)

OR, Login your 115 and Save the cookies to file 'C:\Users<You>.115.cookies' in format 'Semicolon separated name=value pairs' by EditThisCookie.

Install Release Binary and Run on Win10

Get the 115 cookies file as above at first.

Then,

  1. Download the latest version zip file in release page;
  2. Extract zip file to your Win10 PC (e.g.: C:\Users<You>\AppData\Local\Offline-115);
  3. Add the folder path you extracted in step 2 to PATH (the Windows Environment Variable);
  4. Open Powershell or CMD, run offl115 --check and offl115 -m "magnet:?xt=urn:btih:<Your-magnet-url>".

Install by pip and Run on Win10

Get the 115 cookies file as above at first.

Then,

$ pip install Offline-115
$ offl115 -h
$ offl115 --check (Make sure it prints 'The 115 cookies are Ok!')
$ offl115 -m "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a"

Install from source code and Run on Win10

(* Need Git for Windows)

Get the 115 cookies file as above at first.

Then,

$ git clone https://github.com/owtotwo/Offline-115.git
$ cd Offline-115
$ py -3 setup.py install
$ offl115 -h
$ offl115 --check (Make sure it prints 'The 115 cookies are Ok!')
$ offl115 -m "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a"

OR, just run the script:

$ git clone https://github.com/owtotwo/Offline-115.git
$ cd Offline-115
$ py -3 offline_115.py -h
$ py -3 offline_115.py --check (Make sure it prints 'The 115 cookies are Ok!')
$ py -3 offline_115.py -m "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a"

Usage

设定Cookies (在115浏览器中登录115后获取)

  • 请在115浏览器登录后,推荐使用 EditThisCookie 插件导出 cookies 到 {HOMEPATH}/.115.cookies 即 可正常使用。
  • Cookies 只支持分号分隔的格式(Semicolon separated name=value pairs),如a=1;b=2;c=3;
  • 脚本对于115cookies路径会根据以下顺序获取:
    1. 命令行参数中-c/--cookies指定的cookies文件路径
    2. 环境变量中 OFFLINE_115_COOKIES_PATH 变量所指定的路径
    3. 默认路径 {HOMEPATH}/.115.cookies

Help (显示命令行使用方法)

$ offl115 -h

Check cookies (检查本地115cookies文件是否合法)

Run with default cookies path:

$ offl115 --check
115 cookies file path is C:\Users\<You>\.115.cookies ...
The 115 cookies are Ok!

Run in CMD:

$ set OFFLINE_115_COOKIES_PATH=C:\Users\<You>\Documents\115.cookies && offl115 --check
Environment Variable `OFFLINE_115_COOKIES_PATH` Found!
115 cookies file path is C:\Users\<You>\Documents\115.cookies ...
The 115 cookies are Ok!

Run with option -c or --cookies:

$ offl115 --check -c "C:\Your\New\Path\cookies.txt"
115 cookies file path is C:\Your\New\Path\cookies.txt ...
The 115 cookies are Ok!

Add torrent (单个本地种子文件)

$ offl115 -t "C:\Users\<You>\Desktop\abc.torrent"

Add magnet (单个磁力链接)

$ offl115 -m "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a"

Add magnet (用其他路径的115cookies文件添加单个磁力链接)

$ offl115 -c "C:\Your\New\Path\cookies.txt" -m "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a"

Add multiple torrents (多个本地种子文件)

$ offl115 -t "C:\Users\<You>\Desktop\abc.torrent" "C:\Users\<You>\Desktop\def.torrent"

Add multiple magnets (多个磁力链接)

$ offl115 -m "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a" "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88b"

Help (显示命令行工具当前版本)

$ offl115 -v

Related Repo

coolzilj/lixian-115

License

LGPLv3 © owtotwo

Release files for Offline-115 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Offline-115 0.1.7
File Size Uploaded
Offline-115-0.1.7.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Offline-115 0.1.7
File Interpreter ABI Platform
Offline_115-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / Offline-115-0.1.7.tar.gz

Download URL Offline-115-0.1.7.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8623cde7d2df7cdbcefa07e41b5d190b4745165199c9315da81447da0086dfd0
BLAKE2b-256 checksum
How to use checksums
9654bb8202df5c6d57163305114fa99ddb0c3853985b75912f81562bbf8e8111
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release files / Offline_115-0.1.7-py3-none-any.whl

Download URL Offline_115-0.1.7-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5f697ae0bfdd06c3ba0d5832eb24b9eb6d42c5706afd24503f4443b969d6235
BLAKE2b-256 checksum
How to use checksums
a9bcdc172a59fad10eb4662e5b6a9846d956018dde65711170426d1b983695be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.5

2 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page