店播爬取Python脚本

ali_oss.py 778B

1234567891011121314151617181920
  1. import oss2
  2. class AliOss:
  3. AccessKeyId = 'LYu38mijwUW440A4'
  4. AccessKeySecret = '5yQum5XXdqlP9lx8YQojwyrciB0hu4'
  5. BucketName = 'shop-live'
  6. EndPoint = 'http://oss-cn-beijing-internal.aliyuncs.com/'
  7. BaseUrl = 'shop-live.oss-cn-beijing-internal.aliyuncs.com/shop_live/'
  8. @classmethod
  9. def get_auth_bucket(cls):
  10. # 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
  11. auth = oss2.Auth(cls.AccessKeyId, cls.AccessKeySecret)
  12. # Endpoint以杭州为例,其它Region请按实际情况填写。
  13. bucket = oss2.Bucket(auth, cls.EndPoint, cls.BucketName)
  14. return bucket