2021-06-27 15:30:00 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <random>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "auth-oauth.hpp"
|
|
|
|
|
2021-08-15 21:26:01 -07:00
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
class BrowserDock;
|
|
|
|
#endif
|
|
|
|
|
2021-08-22 15:21:33 -07:00
|
|
|
inline const std::vector<Auth::Def> youtubeServices = {
|
2021-09-04 20:35:21 -07:00
|
|
|
{"YouTube - RTMP", Auth::Type::OAuth_LinkedAccount, true, true},
|
|
|
|
{"YouTube - RTMPS", Auth::Type::OAuth_LinkedAccount, true, true},
|
|
|
|
{"YouTube - HLS", Auth::Type::OAuth_LinkedAccount, true, true}};
|
2021-06-27 15:30:00 -07:00
|
|
|
|
|
|
|
class YoutubeAuth : public OAuthStreamKey {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
bool uiLoaded = false;
|
|
|
|
std::string section;
|
|
|
|
|
2021-08-15 21:26:01 -07:00
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
QSharedPointer<BrowserDock> chat;
|
|
|
|
QSharedPointer<QAction> chatMenu;
|
|
|
|
#endif
|
|
|
|
|
2021-06-27 15:30:00 -07:00
|
|
|
virtual bool RetryLogin() override;
|
|
|
|
virtual void SaveInternal() override;
|
|
|
|
virtual bool LoadInternal() override;
|
|
|
|
virtual void LoadUI() override;
|
|
|
|
|
|
|
|
QString GenerateState();
|
|
|
|
|
|
|
|
public:
|
|
|
|
YoutubeAuth(const Def &d);
|
|
|
|
|
2021-08-15 21:26:01 -07:00
|
|
|
void SetChatId(QString &chat_id);
|
|
|
|
void ResetChat();
|
|
|
|
|
2021-06-27 15:30:00 -07:00
|
|
|
static std::shared_ptr<Auth> Login(QWidget *parent,
|
|
|
|
const std::string &service);
|
|
|
|
};
|