Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDing committed Apr 26, 2014
0 parents commit 7fb7b4b
Show file tree
Hide file tree
Showing 8 changed files with 1,776 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Rope
.ropeproject

# Django stuff:
*.log
*.pot

# Sphinx documentation
docs/_build/

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 PeterDing

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
176 changes: 176 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
## iscript

包含项目:

- xiami.py - 下载或播放高品质虾米音乐(xiami.com)

- pan.baidu.com.py - 百度网盘的下载和播放

- youku_parser.py - 下载或播放在线视频

- tumblr.py - 下载某个tumblr.com的所有图片

- unzip.py - 解决linux下unzip乱码的问题

- torrent2magnet.py - 种子转磁力

- 待续

---

---

### xiami.py - 下载或播放高品质虾米音乐(xiami.com)

1. 依赖

python2-requests (https://github.com/kennethreitz/requests)

python2-mutagen (https://code.google.com/p/mutagen/)

mpv (http://mpv.io)

2. 使用说明

在源码中填入email和password后,可以将播放记录提交到虾米。

!!! vip账户支持高品质音乐的下载和播放。

默认执行下载,如要播放,加参数-p。

下载的MP3默认添加id3 tags,保存在当前目录下。

日志保存在 ~/.Xiami.log, cookies保存在 ~/.Xiami.cookies。

3. 用法

\# xm 是xiami.py的马甲 (alias xm='python2 /path/to/xiami.py')

# 下载专辑
xm http://www.xiami.com/album/168709?spm=a1z1s.6928801.1561534521.114.ShN6mD

# 下载单曲
xm http://www.xiami.com/song/2082998?spm=a1z1s.6659513.0.0.DT2j7T

# 下载精选集
xm http://www.xiami.com/song/showcollect/id/30374035?spm=a1z1s.3061701.6856305.16.fvh75t

# 下载该艺术家所有专辑或top 20歌曲
xm http://www.xiami.com/artist/23460?spm=a1z1s.6928801.1561534521.115.ShW08b

# 下载用户的收藏
xm http://www.xiami.com/u/141825?spm=a1z1s.3521917.0.0.zI0APP


播放:

# url 是上面的
xm -p url

---

### pan.baidu.com.py - 百度网盘的下载和播放

1. 依赖

wget, aria2

python2-requests (https://github.com/kennethreitz/requests)

mpv (http://mpv.io)

mplayer # 我的linux上mpv播放wmv出错,换用mplayer

2. 使用说明

在源码中填入百度账户username和password后,可以递归下载自己的网盘文件。

分享的网盘连接中只支持单个文件的下载。

下载工具默认为wget, 可用参数-a选用aria2

对所有文件,默认执行下载,如要播放媒体文件,加参数-p。

下载的文件,保存在当前目录下。

cookies保存在 ~/.bp.cookies

3. 用法

\# bp 是pan.baidu.com.py的马甲 (alias bp='python2 /path/to/pan.badiu.com.py')

# 下载自己网盘中的*单个文件*
bp http://pan.baidu.com/disk/home#dir/path=/path/to/filename
# or
bp path=/path/to/filename

# 递归下载自己网盘中的*文件夹*
bp http://pan.baidu.com/disk/home#dir/path=/path/to/directory
# or
bp path=/path/to/directory

# 下载别人分享的*单个文件*
bp http://pan.baidu.com/s/1o64pFnW
bp http://pan.baidu.com/share/link?shareid=1622654699&uk=1026372002&fid=2112674284

# 下载别人加密分享的*单个文件*,密码参数-s
bp -s vuej http://pan.baidu.com/s/1i3FVlw5

# 下载用aria2, url 是上面的
bp -a url
bp -a -s [secret] url

播放

# url 是上面的
bp -p url
bp -s [secret] -p url

---

### tumblr.py - 下载某个tumblr.com的所有图片

1. 依赖

wget

python2-requests (https://github.com/kennethreitz/requests)

2. 使用说明

使用前需用在 http://www.tumblr.com/oauth/apps 加入一个app,证实后得到api_key,再在源码中填入,完成后则可使用。

默认开5个进程,如需改变用参数-p [num]

下载的文件,保存在当前目录下。

3. 用法

\# tm是tumblr.py的马甲 (alias vx='python2 /path/to/tumblr.py')

tm http://sosuperawesome.tumblr.com/

---

### unzip.py - 解决linux下unzip乱码的问题

用法

unzip.py azipfile.zip

---

### torrent2magnet.py - 种子转磁力

1. 依赖
python3

2. 使用说明

将一个目录下的所有torrent转换成magnet,并保存于当前目录的magnet_link文件中。

2. 用法

\# ttm是torrent2magnet.py的马甲 (alias vx='python2 /path/to/torrent2magnet.py')

ttm /path/to/directory
Loading

0 comments on commit 7fb7b4b

Please sign in to comment.