Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
access through twitch api key (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
d42 authored and alamminsalo committed Dec 30, 2019
1 parent c2390ad commit f8a2b57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/network/networkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void NetworkManager::getChannelPlaybackStream(const QString &channelName)
+ QString("/channels/%1").arg(channelName)
+ QString("/access_token");
QNetworkRequest request;
request.setRawHeader("Client-ID", getClientId().toUtf8());
request.setRawHeader("Client-ID", getPrivateClientId().toUtf8());
request.setUrl(QUrl(url));

request.setAttribute(QNetworkRequest::User, LIVE);
Expand Down Expand Up @@ -343,7 +343,7 @@ void NetworkManager::getBroadcastPlaybackStream(const QString &vod)
+ QString("/vods/%1").arg(vod)
+ QString("/access_token");
QNetworkRequest request;
request.setRawHeader("Client-ID", getClientId().toUtf8());
request.setRawHeader("Client-ID", getPrivateClientId().toUtf8());
request.setUrl(QUrl(url));

request.setAttribute(QNetworkRequest::User, VOD);
Expand Down
1 change: 1 addition & 0 deletions src/network/networkmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class NetworkManager: public QObject

//TODO: move to new class if more operations need to be added
Q_INVOKABLE QString getClientId() const { return QString(CLIENT_ID); }
Q_INVOKABLE QString getPrivateClientId() const { return QString(CLIENT_ID_PRIVATE); }
Q_INVOKABLE bool networkAccess();

signals:
Expand Down
1 change: 1 addition & 0 deletions src/network/urls.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
#define BTTV_API "https://api.betterttv.net/2"
#define TWITCH_API_V5 "https://api.twitch.tv/v5"
#define CLIENT_ID "0dpzlnp1w2bjlim3ldp0u96o4dq2gm"
#define CLIENT_ID_PRIVATE "kimne78kx3ncx6brgo4mv6wki5h1ko"

#endif // URLS_H

0 comments on commit f8a2b57

Please sign in to comment.