shensong00 3 yıl önce
ebeveyn
işleme
d5cb2f0e1f
1 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 6 6
      douyin_hourly_ranklist_commerce_scraper.py

+ 6 - 6
douyin_hourly_ranklist_commerce_scraper.py

@@ -91,10 +91,10 @@ def get_commerce_rank_list_data(room_id, sec_anchor_id, anchor_id, result):
91 91
         "os_api" : "23",
92 92
         "device_type" : device_type,
93 93
         "ssmix" : "a",
94
-        "manifest_version_code" : "130001",
94
+        "manifest_version_code" : f'{V1}{V2}0',#"130001",
95 95
         "dpi" : "480",
96 96
         "app_name" : "aweme",
97
-        "version_name" : "13.0.0",
97
+        "version_name" : f'{V1}.{V2}.0',#"13.0.0",
98 98
         "ts" : str(ts),
99 99
         "cpu_support64" : "true",
100 100
         "storage_type" : "0",
@@ -102,12 +102,12 @@ def get_commerce_rank_list_data(room_id, sec_anchor_id, anchor_id, result):
102 102
         "appTheme" : "dark",
103 103
         "ac" : "wifi",
104 104
         "host_abi" : "armeabi-v7a",
105
-        "update_version_code" : "13009900",
105
+        "update_version_code" : f'{V1}{V2}02',#"13009900",
106 106
         "channel" : "tengxun_new",
107 107
         "_rticket" : rticket,
108 108
         "device_platform" : "android",
109 109
         "iid" : str(iid),
110
-        "version_code" : "130000",
110
+        "version_code" : f'{V1}{V2}0',#"130000",
111 111
         "mac_address" : mc,
112 112
         "cdid" : "81542dc6-2aca-4ff6-ac58-d94179e9d3e6",
113 113
         "openudid" : str(openudid),
@@ -126,7 +126,7 @@ def get_commerce_rank_list_data(room_id, sec_anchor_id, anchor_id, result):
126 126
 
127 127
     xGorgon = X_Gorgon(query_params, body)
128 128
 
129
-    userAgent = f'com.ss.android.ugc.aweme/1300001 (Linux; U; Android 5.1.1; zh_CN; {device_type}; Build/LMY47V; Cronet/58.0.2991.0)'
129
+    userAgent = f'com.ss.android.ugc.aweme/{V1}{V2}0 (Linux; U; Android 5.1.1; zh_CN; {device_type}; Build/LMY47V; Cronet/58.0.2991.0)'
130 130
 
131 131
     headers = {
132 132
         'Host': domain,
@@ -147,7 +147,7 @@ def get_commerce_rank_list_data(room_id, sec_anchor_id, anchor_id, result):
147 147
     response_json = None
148 148
 
149 149
     while True:
150
-        if retry > 20:
150
+        if retry > 0:
151 151
             break
152 152
 
153 153
         retry += 1