admin 发布的文章

出错提示“获取目录下的文件列表: 遇到错误, 远端服务器返回错误, 代码: 4, 消息: No permission to do this operation ”。
解决办法:更改APPID。
打开C:/Users/Administrator/AppData/Roaming/BaiduPCS-Go/pcs_config.json

获取可用APPID的脚本

from __future__ import print_function

import requests
import threading

import sys


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


class GetterTread(threading.Thread):
    def __init__(self, thread_id, app_id, times=1000):
        threading.Thread.__init__(self)

        self.__thread_id = thread_id

        self.__URL = "http://pcs.baidu.com/rest/2.0/pcs/file?app_id={}&method=list&path=%2F"

        with open("./BDUSS.txt") as f:
            BDUSS = f.readline()
            self.__COOKIES = {"BDUSS": BDUSS}

        self.app_id = app_id
        self.times = times

    def run(self):
        current_id = self.app_id
        while current_id - self.app_id < self.times:  # 250000:
            url = self.__URL.format(current_id)

            try:
                r = requests.get(url, cookies=self.__COOKIES)
                if r.status_code == 200:
                    print(current_id)
            except Exception:
                eprint("Exception: " + str(current_id))
                break
            current_id += 1
            # print("id " + str(self.__thread_id) + " over")


if __name__ == '__main__':

    start_app_id = 300000
    times = 1000

    threads_list = []

    while start_app_id < 500000:
        thread = GetterTread(start_app_id, start_app_id, times)
        thread.start()
        threads_list.append(thread)
        start_app_id += times

    # print("size: " + str(len(threads_list)))

    for thread in threads_list:
        thread.join()

附件
baidupcs.7z

莫名其妙出了错.
复杂的方式:
创建恢复U盘.还要官网下订单,特殊的客户端下载.下载完要14个G.压到U盘里.

简单的方式:
重启,
Enter,进入快速选择菜单.
F11,进入恢复模式.
RESET.

两种方式.

1,requests


#!/usr/bin/env python
# -- coding: utf-8 --
import requests
import ssl
requests.packages.urllib3.disable_warnings()
url = 'https://www.douban.com/'
c = requests.get(url,timeout=5,verify=False)
html = c.text
print html
#print html.encode("GBK", 'ignore'); 
exit()

如果是用cmd下面调试,要用encode gbk.

2,pycurl


#!/usr/bin/env python
# -- coding: utf-8 --
import pycurl
import certifi
url = 'https://202.55.9.30/'
c = pycurl.Curl()
c.setopt(c.URL, url)
c.setopt(pycurl.CAINFO, certifi.where())
# Follow redirect.
c.setopt(c.FOLLOWLOCATION, True)
c.setopt(c.SSL_VERIFYHOST,False);
c.setopt(c.SSL_VERIFYPEER,False);
html = c.perform()
c.close()
print html;
#print html.encode("GBK", 'ignore');
exit()

4,urllib2


#!/usr/bin/env python
# -- coding: utf-8 --
import urllib2
import ssl

ssl._create_default_https_context = ssl._create_unverified_context
f = urllib2.urlopen("https://202.55.9.30/")
html = f.read()
f.close()
print html

刷机的过程中.发现Google Pixel2存在两个slot A和B
但是我这里的fastboot不支持.
开始尝试用TWRP里面reboot下面的slot切换来弄.结果不行.
折腾半天,最终还是升级fastboot,搞定.