def get_user_id():
    client = MongoDB.MongoClient('mongodb://localhost:27017/')
    db = client['test']
    a = 1
    try:
        # for raw_data in db.user.find({}):
        for raw_data in db.user_show.find({}):
            user_id = raw_data['user_id']
            print(a)
            # if a >= 9534:
            try:
                total_list = List()
                # print('1')
                list_all = total_list.get_list(
                    user_id, 0)  # 248958316梦泽   278487128我   33759252仓
                print(list_all)
                # print('2')
                list_week = total_list.get_list(user_id, 1)
                # print('3')
                for i in range(0, 2):
                    if i == 0:
                        total_list.get_info(list_all, user_id, i)
                        # print('4')
                    else:
                        total_list.get_info(list_week, user_id, i)
                        # print('5')
                a = a + 1
                # time.sleep(random.randint(0, 10))
            except Exception as e:
                print('error 000:', end=' ')
                print(e)
            # else:
            #     a = a + 1
            # MongoDB.MongoClient.close_cursor()
    except Exception as e:
        print('error 001:', end=' ')
        print(e)
import requests
import MongoDB
import AES
import json
import time
import random
import pymongo
from http.cookiejar import LWPCookieJar
import threading

client = MongoDB.MongoClient('mongodb://localhost:27017/')
db = client['test']
user = db['data_show']

head = {
    'Connection':
    'Keep-Alive',
    'Accept':
    'text/html, application/xhtml+xml, */*',
    'Accept-Language':
    'en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3',
    'User-Agent':
    'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko'
}


class List(object):
    headers = {
        'Host':
        'music.163.com',
        'Connection':