import apiclient
from google.oauth2 import service_account
SCOPES = ['https://www.googleapis.com/auth/androidpublisher']
credentials = service_account.Credentials.from_service_account_file('client_secret.json', scopes=SCOPES)
service = apiclient.discovery.build('androidpublisher','v2',credentials=credentials)
items = service.reviews().list(packageName='com.ea.game.nfs14_row').execute()
for data in items:
print(data)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/androidpublisher/v2/applications/com.ea.game.nfs14_row/reviews?alt=json returned "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.">
from flask import Flask
import os
from werkzeug.contrib.fixers import ProxyFix
from flask_mail import Mail, Message
# Инициализация приложения
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
class Config():
DEBUG = True
TESTING = True
HOST = '192.168.0.13'
PORT = 8889
MAIL_USERNAME = 'tarabrin@pc'
MAIL_PASSWORD = ''
MAIL_DEFAULT_SENDER = 'tarabrin@pc'
MAIL_SERVER = 'localhost'
MAIL_PORT = 25
MAIL_USE_SSL = False
app.config.from_object(Config)
print(app.config.get('MAIL_SERVER'))
# Прикручиваем почту
mail = Mail(app)
@app.route('/send/mail/', methods=['GET'])
def index():
msg = Message("Hello", sender="tarabrin@pc", recipients=["xbox1995@yandex.ru"])
msg.body = "testing"
msg.html = "<b>testing</b>"
mail.send(msg)
return 'Ok'
if __name__ == '__main__':
try:
app.run(
host=app.config.get('HOST', None),
port=app.config.get('PORT', None),
debug=app.config.get('DEBUG', False)
)
except OSError as e:
print(e.strerror)
echo 'Test msg' | mail -s 'test subj' your@mail.ru
MAIL_SERVER = "localhost"
MAIL_PORT = 25
MAIL_USE_TLS = False
MAIL_USE_SSL = False
MAIL_DEBUG = DEBUG
MAIL_USERNAME = "tarabrin@pc"
MAIL_PASSWORD = None
MAIL_DEFAULT_SENDER = "tarabrin@pc"
MAIL_MAX_EMAILS = None
MAIL_SUPPRESS_SEND = TESTING
MAIL_ASCII_ATTACHMENTS = False
# Инициализация приложения
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
app.config.from_pyfile(os.path.join(app.root_path, 'config', 'config.py'))
# Прикручиваем почту
mail = Mail(app)
Что за API нужно использовать? Для авторизации нужно OAuth2 использовать?