lazyad 0.0.30__py3-none-any.whl → 0.0.32__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.

@@ -557,3 +557,133 @@ def get_material_report(
557
557
  json=data,
558
558
  headers=headers
559
559
  )
560
+
561
+
562
+ def get_account_report(
563
+ cookie: str,
564
+ media_type: str,
565
+ start_date: str = None,
566
+ end_date: str = None,
567
+ page: int = 1,
568
+ page_size: int = 20,
569
+ sort_field: str = "cost",
570
+ sort_direction: str = "desc",
571
+ data_type: str = "list",
572
+ conditions: dict = None,
573
+ kpis: list = None,
574
+ base_infos: list = None,
575
+ time_line: str = "REPORTING_TIME"
576
+ ):
577
+ """
578
+ 推广-广告管理-媒体账户
579
+ :param cookie:
580
+ :param start_date: 数据开始日期,默认为当日
581
+ :param end_date: 数据结束日期,默认为当日
582
+ :param page: 页码
583
+ :param page_size: 每页数量
584
+ :param media_type: 媒体:gdt_upgrade|腾讯广告3.0,
585
+ :param sort_field: 排序字段
586
+ :param sort_direction: 排序方式,desc降序
587
+ :param data_type:
588
+ :param conditions: 搜索条件
589
+ :param kpis: 需要获取的字段
590
+ :return:
591
+ """
592
+ if not start_date:
593
+ start_date = lazytime.get_date_string(days=0)
594
+ if not end_date:
595
+ end_date = lazytime.get_date_string(days=0)
596
+ url = "https://cli2.mobgi.com/MainPanelReport/AccountReport/getReport"
597
+ data = {
598
+ "data_type": data_type,
599
+ "media_type": media_type,
600
+ "sort_field": sort_field,
601
+ "sort_direction": sort_direction,
602
+ "page": page,
603
+ "page_size": page_size,
604
+ "start_date": start_date,
605
+ "end_date": end_date,
606
+ "time_line": time_line
607
+ }
608
+ if media_type == "gdt_upgrade":
609
+ if not conditions:
610
+ conditions = {
611
+ "keyword": "",
612
+ "owner_user_id": [],
613
+ "company": [],
614
+ "media_project_id": [],
615
+ "balance": "",
616
+ "time_line": "REPORTING_TIME"
617
+ }
618
+ if not kpis:
619
+ kpis = [
620
+ "cost",
621
+ "thousand_display_price",
622
+ "cpc",
623
+ "conversions_count",
624
+ "conversions_cost",
625
+ "from_follow_uv",
626
+ "from_follow_cost",
627
+ "cheout_fd"
628
+ ]
629
+ if not base_infos:
630
+ base_infos = [
631
+ "advertiser_id",
632
+ "advertiser_nick",
633
+ "user_name",
634
+ "advertiser_name",
635
+ "balance",
636
+ "daily_budget"
637
+ ]
638
+ else:
639
+ showlog.warning("未知媒体类型")
640
+ return
641
+
642
+ headers = copy.deepcopy(default_headers)
643
+ headers["Cookie"] = cookie
644
+ data["conditions"] = conditions
645
+ data["kpis"] = kpis
646
+ data["base_infos"] = base_infos
647
+ return lazyrequests.lazy_requests(
648
+ method="POST",
649
+ url=url,
650
+ json=data,
651
+ headers=headers
652
+ )
653
+
654
+
655
+ def update_budget_batch(
656
+ cookie: str,
657
+ media_type: str,
658
+ media_account_id: str = None,
659
+ daily_budget: str = None
660
+ ):
661
+ """
662
+ 修改账户日预算
663
+ :param cookie:
664
+ :return:
665
+ """
666
+ if media_type == "gdt":
667
+ # 目前只有旧版可以改,新版的无法改
668
+ url = "https://cli2.mobgi.com/Gdt/MainList/updateBudgetBatch"
669
+ data = {
670
+ "data": [
671
+ {
672
+ "media_account_id": media_account_id,
673
+ "daily_budget": daily_budget
674
+ }
675
+ ],
676
+ "time": "now"
677
+ }
678
+ else:
679
+ showlog.warning("未知媒体类型")
680
+ return
681
+
682
+ headers = copy.deepcopy(default_headers)
683
+ headers["Cookie"] = cookie
684
+ return lazyrequests.lazy_requests(
685
+ method="POST",
686
+ url=url,
687
+ json=data,
688
+ headers=headers
689
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -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=wnfWfJ_n-Z8LNeP1NSz5R2_F2Kg5AqCb-VvDJG9t7WQ,16800
3
+ lazyad/crawlers/chuangliang.py,sha256=s_0agSrJIvrz4Eke1RolFrr-IRrBKiECdo5nCIBqY98,20428
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.30.dist-info/METADATA,sha256=qsJxeHf857ao6i_uvtt9Ihmt5gZMjMKbCN25eXa9tfk,1695
9
- lazyad-0.0.30.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
10
- lazyad-0.0.30.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
11
- lazyad-0.0.30.dist-info/RECORD,,
8
+ lazyad-0.0.32.dist-info/METADATA,sha256=ObTWMEsae6RN8JBKkeB74h2j7jqYI6wzSxeGAOM3HBE,1695
9
+ lazyad-0.0.32.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
10
+ lazyad-0.0.32.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
11
+ lazyad-0.0.32.dist-info/RECORD,,