lazyad 0.0.34__py3-none-any.whl → 0.0.36__py3-none-any.whl
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/crawlers/chuangliang.py +134 -0
- {lazyad-0.0.34.dist-info → lazyad-0.0.36.dist-info}/METADATA +1 -1
- {lazyad-0.0.34.dist-info → lazyad-0.0.36.dist-info}/RECORD +5 -5
- {lazyad-0.0.34.dist-info → lazyad-0.0.36.dist-info}/WHEEL +0 -0
- {lazyad-0.0.34.dist-info → lazyad-0.0.36.dist-info}/top_level.txt +0 -0
lazyad/crawlers/chuangliang.py
CHANGED
|
@@ -701,3 +701,137 @@ def update_budget_batch(
|
|
|
701
701
|
json=data,
|
|
702
702
|
headers=headers
|
|
703
703
|
)
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
def get_task_result(
|
|
707
|
+
cookie: str,
|
|
708
|
+
batch_id: str
|
|
709
|
+
):
|
|
710
|
+
"""
|
|
711
|
+
获取任务结果
|
|
712
|
+
:param cookie:
|
|
713
|
+
:param batch_id:
|
|
714
|
+
:return:
|
|
715
|
+
"""
|
|
716
|
+
url = "https://cli2.mobgi.com/Toutiao/Tools/getTaskResult"
|
|
717
|
+
data = {"batch_id": batch_id}
|
|
718
|
+
headers = copy.deepcopy(default_headers)
|
|
719
|
+
headers["Cookie"] = cookie
|
|
720
|
+
return lazyrequests.lazy_requests(
|
|
721
|
+
method="POST",
|
|
722
|
+
url=url,
|
|
723
|
+
json=data,
|
|
724
|
+
headers=headers
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
def get_task_result_end(
|
|
729
|
+
cookie: str,
|
|
730
|
+
batch_id: str
|
|
731
|
+
):
|
|
732
|
+
"""
|
|
733
|
+
获取任务结果,等待任务结束
|
|
734
|
+
:param cookie:
|
|
735
|
+
:param batch_id:
|
|
736
|
+
:return:
|
|
737
|
+
"""
|
|
738
|
+
while True:
|
|
739
|
+
res = get_task_result(
|
|
740
|
+
cookie=cookie,
|
|
741
|
+
batch_id=batch_id
|
|
742
|
+
)
|
|
743
|
+
if res.get("code") == 0:
|
|
744
|
+
processing = res["data"]["processing"]
|
|
745
|
+
if not processing:
|
|
746
|
+
return res
|
|
747
|
+
else:
|
|
748
|
+
lazytime.count_down(1)
|
|
749
|
+
else:
|
|
750
|
+
return res
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
def get_project_report(
|
|
754
|
+
cookie: str,
|
|
755
|
+
media_type: str = "aggregate",
|
|
756
|
+
start_date: str = None,
|
|
757
|
+
end_date: str = None,
|
|
758
|
+
page: int = 1,
|
|
759
|
+
page_size: int = 20,
|
|
760
|
+
sort_field: str = "aggregate_cost",
|
|
761
|
+
sort_direction: str = "desc",
|
|
762
|
+
data_type: str = "list",
|
|
763
|
+
conditions: dict = None,
|
|
764
|
+
kpis: list = None,
|
|
765
|
+
relate_dims: list = None,
|
|
766
|
+
time_line: str = "REPORTING_TIME",
|
|
767
|
+
time_dim: str = "days",
|
|
768
|
+
data_dim: str = "media_project_id"
|
|
769
|
+
):
|
|
770
|
+
"""
|
|
771
|
+
报表-项目报表
|
|
772
|
+
:param cookie:
|
|
773
|
+
:param media_type: 媒体:aggregate|不限
|
|
774
|
+
:param start_date: 数据开始日期,默认为当日
|
|
775
|
+
:param end_date: 数据结束日期,默认为当日
|
|
776
|
+
:param page: 页码
|
|
777
|
+
:param page_size: 每页数量
|
|
778
|
+
:param sort_field: 排序字段
|
|
779
|
+
:param sort_direction: 排序方式,desc降序
|
|
780
|
+
:param data_type:
|
|
781
|
+
:param conditions: 搜索条件
|
|
782
|
+
:param kpis: 需要获取的字段
|
|
783
|
+
:param relate_dims:
|
|
784
|
+
:param time_line:
|
|
785
|
+
:param time_dim:
|
|
786
|
+
:param data_dim:
|
|
787
|
+
:return:
|
|
788
|
+
"""
|
|
789
|
+
if not start_date:
|
|
790
|
+
start_date = lazytime.get_date_string(days=0)
|
|
791
|
+
if not end_date:
|
|
792
|
+
end_date = lazytime.get_date_string(days=0)
|
|
793
|
+
url = "https://cli2.mobgi.com/ReportV23/ProjectReport/getReport"
|
|
794
|
+
data = {
|
|
795
|
+
"time_dim": time_dim,
|
|
796
|
+
"media_type": media_type,
|
|
797
|
+
"data_type": data_type,
|
|
798
|
+
"data_dim": data_dim,
|
|
799
|
+
"sort_field": sort_field,
|
|
800
|
+
"sort_direction": sort_direction,
|
|
801
|
+
"start_date": start_date,
|
|
802
|
+
"end_date": end_date,
|
|
803
|
+
"page": page,
|
|
804
|
+
"page_size": page_size
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
if not conditions:
|
|
808
|
+
conditions = {
|
|
809
|
+
"media_project_id": [],
|
|
810
|
+
"advertiser_id": [],
|
|
811
|
+
"media_type": "",
|
|
812
|
+
"project_id": [],
|
|
813
|
+
"owner_user_id": [],
|
|
814
|
+
"media_agent_id": [],
|
|
815
|
+
"time_line": time_line
|
|
816
|
+
}
|
|
817
|
+
if not kpis:
|
|
818
|
+
kpis = [
|
|
819
|
+
"aggregate_cost"
|
|
820
|
+
]
|
|
821
|
+
if not relate_dims:
|
|
822
|
+
relate_dims = [
|
|
823
|
+
"owner_user_id",
|
|
824
|
+
"media_type"
|
|
825
|
+
]
|
|
826
|
+
|
|
827
|
+
headers = copy.deepcopy(default_headers)
|
|
828
|
+
headers["Cookie"] = cookie
|
|
829
|
+
data["conditions"] = conditions
|
|
830
|
+
data["kpis"] = kpis
|
|
831
|
+
data["relate_dims"] = relate_dims
|
|
832
|
+
return lazyrequests.lazy_requests(
|
|
833
|
+
method="POST",
|
|
834
|
+
url=url,
|
|
835
|
+
json=data,
|
|
836
|
+
headers=headers
|
|
837
|
+
)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
lazyad/__init__.py,sha256=tnVTFEgdzgMWQI0mZqy3DAueMJjpypPb15DdxJ-9TiU,41
|
|
2
2
|
lazyad/crawlers/__init__.py,sha256=GK3GGpiUJbESc1uGTwSmEnsSUwYDNZfJCxeLYB4CpS4,68
|
|
3
|
-
lazyad/crawlers/chuangliang.py,sha256=
|
|
3
|
+
lazyad/crawlers/chuangliang.py,sha256=zwL3s-WFZ3S--MqgSrOb96XE-fsVjt0vG4sFWHamOD0,24332
|
|
4
4
|
lazyad/crawlers/oceanengine.py,sha256=kjBEpCb_h5OpodCTqzvXd5MBBwAuw3Oq5UKWoTCXrQM,4540
|
|
5
5
|
lazyad/crawlers/qq.py,sha256=mAVOP1TOGVD1juu77uKBauN7vLymukTJ1mJ8uyRh9a8,3230
|
|
6
6
|
lazyad/open/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
lazyad/open/qq.py,sha256=B6HWnBmtF3mbpwto1wqi7j-auK73Kzp8ESxeUpvLHRA,4391
|
|
8
|
-
lazyad-0.0.
|
|
9
|
-
lazyad-0.0.
|
|
10
|
-
lazyad-0.0.
|
|
11
|
-
lazyad-0.0.
|
|
8
|
+
lazyad-0.0.36.dist-info/METADATA,sha256=T3gxSnBQoVoFZpEDvZNpemFF-IOQ4NhlqunihxoxGuU,1695
|
|
9
|
+
lazyad-0.0.36.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
10
|
+
lazyad-0.0.36.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
|
|
11
|
+
lazyad-0.0.36.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|