lazyad 0.0.63__tar.gz → 0.0.65__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lazyad might be problematic. Click here for more details.
- {lazyad-0.0.63 → lazyad-0.0.65}/PKG-INFO +1 -1
- lazyad-0.0.65/lazyad/__init__.py +2 -0
- lazyad-0.0.65/lazyad/crawlers/__init__.py +3 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/crawlers/chuangliang.py +96 -7
- lazyad-0.0.65/lazyad/open/kuaishou.py +31 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.63 → lazyad-0.0.65}/setup.py +1 -1
- lazyad-0.0.63/lazyad/crawlers/__init__.py +0 -0
- lazyad-0.0.63/lazyad/open/__init__.py +0 -0
- lazyad-0.0.63/lazyad/open/kuaishou.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/README.md +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/crawlers/mintegral.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/crawlers/wshoto.py +0 -0
- {lazyad-0.0.63/lazyad → lazyad-0.0.65/lazyad/open}/__init__.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/open/mintegral.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/open/qq.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad/open/unity.py +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.63 → lazyad-0.0.65}/setup.cfg +0 -0
|
@@ -20,6 +20,7 @@ default_headers = {
|
|
|
20
20
|
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0",
|
|
21
21
|
}
|
|
22
22
|
default_host = "cli2.mobgi.com"
|
|
23
|
+
hosts = ["cli1.mobgi.com", "cli2.mobgi.com"]
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
def get_media_account(
|
|
@@ -446,7 +447,8 @@ def get_material_report(
|
|
|
446
447
|
data_type: str = "list",
|
|
447
448
|
sort_direction: str = "desc",
|
|
448
449
|
conditions: dict = None,
|
|
449
|
-
relate_dims: list = None
|
|
450
|
+
relate_dims: list = None,
|
|
451
|
+
host: str = "cli2.mobgi.com",
|
|
450
452
|
):
|
|
451
453
|
"""
|
|
452
454
|
报表-素材报表
|
|
@@ -455,22 +457,26 @@ def get_material_report(
|
|
|
455
457
|
:param end_date:
|
|
456
458
|
:param page:
|
|
457
459
|
:param page_size:
|
|
458
|
-
:param media_type:媒体:gdt_new|广点通(新指标体系),toutiao_upgrade|今日头条2.0
|
|
459
|
-
:param data_dim:
|
|
460
|
+
:param media_type:媒体:gdt_new|广点通(新指标体系),toutiao_upgrade|今日头条2.0/巨量广告,aggregate|不限,baidu:百度信息流
|
|
461
|
+
:param data_dim: 数据维度:素材
|
|
460
462
|
:param data_type:
|
|
461
|
-
:param sort_direction:
|
|
462
|
-
:param sort_field:
|
|
463
|
+
:param sort_direction: 排序
|
|
464
|
+
:param sort_field: 排序字段,stat_cost:消耗
|
|
463
465
|
:param time_dim: 时间维度的数据汇总方式,days:分日,sum:汇总
|
|
464
466
|
:param conditions:
|
|
465
467
|
:param kpis:
|
|
466
|
-
:param relate_dims
|
|
468
|
+
:param relate_dims:关联维度,
|
|
469
|
+
material_create_time:上传时间 --> material_create_time
|
|
470
|
+
owner_user_id:优化师 --> user_name
|
|
471
|
+
creative_user_id:创意人 --> creative_user
|
|
472
|
+
:param host:
|
|
467
473
|
:return:
|
|
468
474
|
"""
|
|
469
475
|
if not start_date:
|
|
470
476
|
start_date = lazytime.get_date_string(days=0)
|
|
471
477
|
if not end_date:
|
|
472
478
|
end_date = lazytime.get_date_string(days=0)
|
|
473
|
-
url = "https://
|
|
479
|
+
url = f"https://{host}/ReportV23/MaterialReport/getReport"
|
|
474
480
|
data = {
|
|
475
481
|
"time_dim": time_dim,
|
|
476
482
|
"media_type": media_type,
|
|
@@ -899,3 +905,86 @@ def deactivate_material(
|
|
|
899
905
|
json=data,
|
|
900
906
|
headers=headers
|
|
901
907
|
)
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
def get_toutiao_promotion(
|
|
911
|
+
cookie: str,
|
|
912
|
+
user_id: list = None,
|
|
913
|
+
material_id: str = None,
|
|
914
|
+
cdt_start_date: str = None,
|
|
915
|
+
cdt_end_date: str = None,
|
|
916
|
+
start_date: str = None,
|
|
917
|
+
end_date: str = None,
|
|
918
|
+
host: str = default_host,
|
|
919
|
+
page: int = 1,
|
|
920
|
+
page_size: int = 20,
|
|
921
|
+
sort_field: str = "create_time",
|
|
922
|
+
sort_direction: str = "desc",
|
|
923
|
+
data_type: str = "list"
|
|
924
|
+
):
|
|
925
|
+
"""
|
|
926
|
+
推广-巨量广告-广告 查询
|
|
927
|
+
:param cookie:
|
|
928
|
+
:param material_id: 素材ID
|
|
929
|
+
:param cdt_start_date: 创建时间,例如:2025-07-05 00:00:00
|
|
930
|
+
:param cdt_end_date: 创建时间,例如:2025-08-04 23:59:59
|
|
931
|
+
:param start_date: 数据日期,例如:2025-08-04
|
|
932
|
+
:param end_date: 数据日期,例如:2025-08-04
|
|
933
|
+
:param host:
|
|
934
|
+
:return:
|
|
935
|
+
"""
|
|
936
|
+
url = f"https://{host}/Toutiao/Promotion/getList"
|
|
937
|
+
if not user_id:
|
|
938
|
+
user_id = []
|
|
939
|
+
conditions = {
|
|
940
|
+
"search_field":"promotion_name",
|
|
941
|
+
"search_keyword":"",
|
|
942
|
+
"cl_project_id":[],
|
|
943
|
+
"cl_app_id":[],
|
|
944
|
+
"user_id": user_id,
|
|
945
|
+
"media_account_id":[],
|
|
946
|
+
"companys":[],
|
|
947
|
+
"landing_type":"",
|
|
948
|
+
"delivery_mode":"",
|
|
949
|
+
"project_id":[],
|
|
950
|
+
"status_first":"",
|
|
951
|
+
"scene_type":[],
|
|
952
|
+
"strategy_id":[],
|
|
953
|
+
"ad_type":"",
|
|
954
|
+
"learning_phase":[],
|
|
955
|
+
"star_delivery_type":"",
|
|
956
|
+
"star_task_id":"",
|
|
957
|
+
"app_type":"",
|
|
958
|
+
"external_action":[],
|
|
959
|
+
"deep_external_action":[],
|
|
960
|
+
"deep_bid_type":[],
|
|
961
|
+
"material_id": material_id,
|
|
962
|
+
"search_type":"like",
|
|
963
|
+
"combinatorial_id":"",
|
|
964
|
+
"status":"",
|
|
965
|
+
"status_second":"",
|
|
966
|
+
"cdt_start_date": cdt_start_date,
|
|
967
|
+
"cdt_end_date": cdt_end_date
|
|
968
|
+
}
|
|
969
|
+
data = {
|
|
970
|
+
"conditions": json.dumps(conditions),
|
|
971
|
+
"start_date": start_date,
|
|
972
|
+
"end_date": end_date,
|
|
973
|
+
"page": page,
|
|
974
|
+
"page_size": page_size,
|
|
975
|
+
# "total_count": 1,
|
|
976
|
+
# "total_page": 1,
|
|
977
|
+
"sort_field": sort_field,
|
|
978
|
+
"sort_direction": sort_direction,
|
|
979
|
+
"data_type": data_type
|
|
980
|
+
}
|
|
981
|
+
headers = copy.deepcopy(default_headers)
|
|
982
|
+
headers["Cookie"] = cookie
|
|
983
|
+
if host:
|
|
984
|
+
headers["Host"] = host
|
|
985
|
+
return lazyrequests.lazy_requests(
|
|
986
|
+
method="POST",
|
|
987
|
+
url=url,
|
|
988
|
+
json=data,
|
|
989
|
+
headers=headers
|
|
990
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from lazysdk import lazyrequests
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def postback(
|
|
5
|
+
callback: str,
|
|
6
|
+
event_time: int,
|
|
7
|
+
event_type: int,
|
|
8
|
+
purchase_amount=None
|
|
9
|
+
):
|
|
10
|
+
"""
|
|
11
|
+
快手回传
|
|
12
|
+
:param callback:
|
|
13
|
+
:param event_time: 时间戳,单位秒
|
|
14
|
+
:param event_type:
|
|
15
|
+
:param purchase_amount:
|
|
16
|
+
:return:
|
|
17
|
+
"""
|
|
18
|
+
# result=1上报成功
|
|
19
|
+
params = {
|
|
20
|
+
"event_type": event_type,
|
|
21
|
+
"event_time": event_time,
|
|
22
|
+
}
|
|
23
|
+
if purchase_amount:
|
|
24
|
+
params["purchase_amount"] = purchase_amount
|
|
25
|
+
res = lazyrequests.lazy_requests(
|
|
26
|
+
method="GET",
|
|
27
|
+
url=callback,
|
|
28
|
+
params=params
|
|
29
|
+
)
|
|
30
|
+
return res
|
|
31
|
+
|
|
@@ -13,7 +13,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
|
|
13
13
|
|
|
14
14
|
setuptools.setup(
|
|
15
15
|
name="lazyad",
|
|
16
|
-
version="0.0.
|
|
16
|
+
version="0.0.65",
|
|
17
17
|
description="基于Python的懒人包-适用于广告投放模块",
|
|
18
18
|
long_description=long_description,
|
|
19
19
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|