auth-youtube.hpp 781 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <QObject>
  3. #include <QString>
  4. #include <random>
  5. #include <string>
  6. #include "auth-oauth.hpp"
  7. const std::vector<Auth::Def> youtubeServices = {
  8. {"YouTube - RTMP", Auth::Type::OAuth_LinkedAccount, true},
  9. {"YouTube - RTMPS", Auth::Type::OAuth_LinkedAccount, true},
  10. {"YouTube - HLS", Auth::Type::OAuth_LinkedAccount, true}};
  11. class YoutubeAuth : public OAuthStreamKey {
  12. Q_OBJECT
  13. bool uiLoaded = false;
  14. std::mt19937 randomSeed;
  15. std::string section;
  16. virtual bool RetryLogin() override;
  17. virtual void SaveInternal() override;
  18. virtual bool LoadInternal() override;
  19. virtual void LoadUI() override;
  20. QString GenerateState();
  21. public:
  22. YoutubeAuth(const Def &d);
  23. static std::shared_ptr<Auth> Login(QWidget *parent,
  24. const std::string &service);
  25. };