捐助个VPS。LA2节点。
目前看应该良好。
手欠。。。。。
修正多P下载错误。
老地方:
https://github.com/cnbeining/Biligrab
代码下面。
Continue reading
为了一个issue,重写了下载和合并模块,结果这个issue的问题还没解决。。。。。
但是倒是支持更多下载器了:aria2c,wget,axel,curl 。
合并模块请大家赐教。
论怎么把代码从34行代码 变成31行 变成17行 变成12行:
'''
data_list = data.split('\r')
for lines in data_list:
lines = str(lines)
if '<url>' in lines:
if 'youku' in lines:
url = lines[17:-9]
elif 'sina' in lines:
url = lines[16:-9]
elif 'qq.com' in lines:
url = lines[17:-9]
elif 'letv.com' in lines:
url = lines[17:-9]
break
elif 'acgvideo' in lines:
url = lines[17:-9]
is_local = 1
rawurl.append(url)
if 'backup_url' in lines and is_local is 1:
break'''
'''
output = commands.getstatusoutput('ffmpeg --help')
if str(output[0]) != '32512':
is_ffmpeg = 1
output = commands.getstatusoutput('avconv --help')
if str(output[0]) != '32512':
is_avconv = 1
output = commands.getstatusoutput('aria2c --help')
if str(output[0]) != '32512':
is_aria2c = 1
output = commands.getstatusoutput('aria2c --help')
if str(output[0]) != '32512':
is_aria2c = 1
output = commands.getstatusoutput('wget --help')
if str(output[0]) != '32512':
is_wget = 1
output = commands.getstatusoutput('curl --help')
if str(output[0]) == '32512':
is_curl = 1
if is_ffmpeg == 1:
concat_software = 'ffmpeg'
elif is_avconv == 1:
concat_software = 'avconv'
else:
print('ERROR: Cannot find any concating software!\nPlease get a ffmpeg or avconv!')
exit()
if is_aria2c == 1:
download_software = 'aria2c'
elif is_wget == 1:
is_aria2c = 'wget'
elif is_curl == 1:
is_aria2c = 'curl'
else:
print('ERROR: Cannot find any downloading software!\nPlease get a aria2c, wget or, at very least, curl!')
exit()
'''
'''
concat_software = ''
download_software = ''
output = commands.getstatusoutput('ffmpeg --help')
if str(output[0]) == '32512':
output = commands.getstatusoutput('avconv --help')
if str(output[0]) == '32512':
print('ERROR: Cannot find any concating software!\nPlease get a ffmpeg or avconv!')
exit()
else:
concat_software = 'avconv'
else:
concat_software = 'ffmpeg'
output = commands.getstatusoutput('aria2c --help')
if str(output[0]) == '32512':
output = commands.getstatusoutput('axel --help')
if str(output[0]) == '32512':
output = commands.getstatusoutput('wget --help')
if str(output[0]) == '32512':
output = commands.getstatusoutput('curl --help')
if str(output[0]) == '32512':
print('ERROR: Cannot find any downloading software!\nPlease get a aria2c, wget or, at very least, curl!')
exit()
else:
download_software = 'curl'
else:
download_software = 'wget'
else:
download_software = 'axel'
else:
download_software = 'aria2c'
'''
'''
if download_software.strip().lower() not in download_software_list:
print('WARNING: Requested Software not supported!\nBiligrab only support these following software(s):\n' + str(download_software_list) + 'Trying to find avalable one...')
for software in download_software_list:
output = commands.getstatusoutput(software + ' --help')
if str(output[0]) != '32512': #If exist
download_software = software
break
if concat_software.strip().lower() not in concat_software_list:
print('WARNING: Requested Software not supported!\nBiligrab only support these following software(s):\n' + str(concat_software_list) + 'Trying to find avalable one...')
for software in concat_software_list:
output = commands.getstatusoutput(software + ' --help')
if str(output[0]) != '32512': #If exist
concat_software = software
break'''总之,上代码,老地方。
https://github.com/cnbeining/Biligrab
Continue reading
MB姐这是和咱玩命的节奏啊。
要是再不行就得再加几个方案了。
海外党请务必升级,国内按需升级。
老地方:https://github.com/cnbeining/Biligrab
代码下面。
Continue reading
一部分照搬了acupload的代码,但是也重写了很多地方。不代表acupload就不能用了。。。
不用requests真不行。
前面按理说应该都用requests重写,懒了。
https://github.com/cnbeining/bilidirectuploader
代码扔下面。
Continue reading
没有测试,请大家测试后反馈是否正常。
应该是没啥问题的。
需要requests,没这货干活太不方便了。
#!/usr/bin/env python3
#coding:utf-8
# Author: Beining --<ACICFG>
# Purpose: Upload to Bilibili via Bilibili's internal uploading method
# Created: 10/01/2014
#python3 bilidirectuploader.py 0.flv 1.flv
import urllib.request
import sys
import os
import json
import subprocess
import hashlib
import requests
global cookiepath
cookiepath = './bilicookies'
global video_list
video_list = ''
#----------------------------------------------------------------------
def upload(file2Upload):
""""""
#Read Cookie.....Damn it I didn't have my supper!
try:
cookies = open(cookiepath, 'r').readline()
#print(cookies)
except:
print('I am hungry, please give me your Cookie!')
exit()
#Get filename
if not os.path.isfile(file2Upload):
print('Not file!')
pass
if os.path.splitext(file2Upload)[1] != '.flv':
print('ERROR: You can only upload .flv file(s)!')
exit()
filename = os.path.basename(file2Upload)
#print(filename)
#Calculate Filesize, since there s 1.4GiB limit
filesize = os.path.getsize(file2Upload)
print('Size of file: ' + str(filesize))
if filesize > (1.4 * 1024 * 1024 * 1024):
print('File larger than 1.4 GiB, unable to upload!')
exit()
#Fetch UploadUrl
request_full = urllib.request.Request('http://member.bilibili.com/get_vupload_url', headers={ 'User-Agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36', 'Cache-Control': 'no-cache', 'Pragma': 'no-cache' , 'Cookie': cookies,})
try:
response = urllib.request.urlopen(request_full)
except Exception:
print('Cannot get response from server!')
pass
data = response.read()
uploadresponse = json.loads(data.decode('utf-8'))
try: # if error happens...
uploadresponse["error_code"]
except KeyError:
pass
except:
print('ERROR: '+ uploadresponse['error_msg'] + ', ' + str(uploadresponse["error_code"]))
sys.exit() # exit the program
#print(uploadresponse['url'])
#make filename
server_ip = str(uploadresponse['server_ip'])
remote_file_name = str(uploadresponse['file_name'])
#start upload
upload_url = str(uploadresponse['url'])
#print(upload_url)
f = open(file2Upload, 'rb')
c = 0
for piece in read_in_chunks(f):
c = c + 1
requests.options(upload_url) #dont really know why
files = {'file': piece}
r = requests.post(upload_url, files=files)
print(str(c * 524288) + '/' + str(filesize) + ' done...')
video_list = video_list + (str('[vupload]' + remote_file_name + ';' + filename + ';' + server_ip + ';[/vupload]\n'))
print('\n'+'Hope everything is fine. '+ '\n' + '[vupload]' + remote_file_name + ';' + filename + ';' + server_ip + ';[/vupload]')
#----------------------------------------------------------------------
def read_in_chunks(file_object, chunk_size=524288):
"""Lazy function (generator) to read a file piece by piece.
Default chunk size: 524288."""
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
#----------------------------------------------------------------------
if __name__=='__main__':
#Test sys encoding
if not sys.getdefaultencoding() is 'utf-8':
os.system('export LC_ALL="en_US.UTF-8"')
total_file_num = len(sys.argv[1:])
i = 0
if len(sys.argv[1:]) == 0:
print('''
Author: Beining http://www.cnbeining.com https://github.com/cnbeining
Require: requests
Usage:
python3 bilidirectuploader.py [file1] [file2] [file3]...
You can only upload .flv file(s) under 1.4 GiB.
If network is bad, change chunk size at L85, and display at L78.
''')
for name in sys.argv[1:]:
#print(name)
i = i + 1
print('Uploading '+ str(i)+' in '+str(total_file_num)+' files...')
upload(name)
if len(video_list) != 0:
print(video_list)
SB的机器出了问题:
I do apologize. We’ve resolved the issue with your container. It does appear that one of our administrators incorrectly typed an IP on another device in the same vlan as our KVM node server.
I will be crediting you 1 month of account credit.
Is there anything else we can do for you?
幸好每日+每周备份。。。。
更新:
我的中文翻译已经merge了,大家可以看中文了。
Beining
之前一直没有推荐Mailvelope。因为这货不能签名,所以一直使用GPGTools。
但是这东西必须和系统整合,所以携带不便。当然有个优点是可以一并加密文件。
现在Mailvelope支持了签名,而且进行了安全审计。所以开始推荐这个东西。
对于不方便使用软件的地方,Mailvelope是极其好用的工具。
以下都以Chrome举例,FF类似。
国产浏览器,安全软件绝对不推荐。
初级篇:
1.安装:
https://www.mailvelope.com/
去Chrome网上商店可以安装。
2.初次使用,设置密钥:

点Options。
如果你没有密钥:
创建密钥:

稍候就好了。
如果你已经有了密钥:

2. 加密邮件
0.
在此之前,你需要先加入收信方的公钥。这个公钥可以在不安全的网络上传递。
例如:
ACI字幕组的CDC邮箱的公钥在这里:
https://forum.chineseaci.com/t-51
你需要复制整个公钥:
-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org cdc@chineseaci.com mQENBFKlnhcBCACWgBL4x+78aqf6Y9jGNqVbcz9g7jlJoq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T4eJwT5a4dZolEM29z0MN2aGpOznIRGRN5B4pPnL8f3kj pWsCWIm+OicKudBULZL0gCK3sh/aTQfGob3DyfZ9CtbrraOu/R0SJygB62y8kVUA EQEAAYkBJQQYAQoADwUCUqWeFwIbDAUJB4YfgAAKCRCHImEwPWDH5Cm7B/9AUJ2h 2e1skoGlEURnDmb4M+rhSIeKj8FiCbI2bHln1//G5GNwztp7V/VAx+URA5z+YJxD qCcbOIVEkwz8wGE+EY/gHhSkRDHTyaWNek0DCSjo2FGx1xktVFNE+V0khOMdA/NF f8G8IBZTGp9yFQGZu6/mhXN3ix4qpFWxoIteDEpnutZdPFgYM2LbwvBSGV07CPI0 SfszzLe3ZNqweWcDv4ZW1Zi8rc0fRM4wBOGVorxiV4Pj+lSnwkqRE3G5s82oPixo y3LsI/vTewjoUFwgoh6ap5WDohxOAujnLcAoPuau40VjyEKB3mO9JGefToUDwJ98 gf16ScSwPavatUMV =wohi -----END PGP PUBLIC KEY BLOCK-----
然后像上面一节那样导入:

1. 如果你的邮箱已经自动内置了关联:


1.1:
签名看起来像这样:
选择你的密钥,就可以签名了。

每次用你需要先解密密钥:

1.2:
加密这么操作:

[important]如果你没有把自己加入收信人,这封邮件你自己也不能解密![/important]
加密后邮件会变成这样:

然后发送就是。
中级篇:
3.1 一些小设置

3.2
加入其他邮箱(特别是国产邮箱):
以网易为例,其他类似:


点击Save。
这样你就可以在任何邮箱使用了。
高级设置:

Cannot find any reason.
https://github.com/ACICFG/youBBS-ACICFG/tree/Beining-add-save-pic
反反盗链会弄得页面里面全是frame,整死强迫症系列。
之前有过imgur封号和封网站的先例,所以我在这里扔上。
这个应该是唯一一个可以不通过服务器转发的反反盗链办法。
Javascript写起来太痛苦了。
利用了HTML5的特性,一开始加载图片的高度会不对。之后应该会自己修正。
强制imgur走https,这样应该不会撞墙。
自取。