summaryrefslogtreecommitdiff
path: root/Plexservice.h
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2014-11-15 19:43:07 +0100
committerchriszero <zerov83@gmail.com>2014-11-15 19:43:07 +0100
commit23f9f7712bfa33b5a488a447a6fabe6035cc3240 (patch)
tree06bbe8e0bc52496c5ad3c41accc7524aa597e670 /Plexservice.h
parenta40adaf76fb1267d38b4c5e6386933ddb2d0d328 (diff)
downloadvdr-plugin-plex-23f9f7712bfa33b5a488a447a6fabe6035cc3240.tar.gz
vdr-plugin-plex-23f9f7712bfa33b5a488a447a6fabe6035cc3240.tar.bz2
initial commit
Diffstat (limited to 'Plexservice.h')
-rw-r--r--Plexservice.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/Plexservice.h b/Plexservice.h
new file mode 100644
index 0000000..a935ef2
--- /dev/null
+++ b/Plexservice.h
@@ -0,0 +1,65 @@
+#ifndef PLEXSERVICE_H
+#define PLEXSERVICE_H
+
+//#include "plexgdm.h"
+#include "PlexServer.h"
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <vector>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <Poco/Base64Encoder.h>
+#include <Poco/Net/HTTPClientSession.h>
+#include <Poco/Net/HTTPSClientSession.h>
+#include <Poco/Net/HTTPRequest.h>
+#include <Poco/Net/HTTPResponse.h>
+#include <Poco/Net/MessageHeader.h>
+#include <Poco/Net/Context.h>
+#include <Poco/Exception.h>
+#include <Poco/Format.h>
+#include <Poco/URI.h>
+
+#include <Poco/StreamCopier.h>
+
+#include "Config.h"
+#include "user.h"
+#include "MediaContainer.h"
+
+namespace plexclient
+{
+
+class Plexservice
+{
+public:
+ Plexservice(PlexServer *server);
+ ~Plexservice();
+
+ void DisplaySections();
+ MediaContainer* GetAllSections();
+ MediaContainer* GetSection(std::string section);
+ void GetAuthDetails();
+ std::string GetMyPlexToken();
+ void Authenticate();
+ //void DiscoverFirstServer();
+ PlexServer* GetServer();
+
+ static MediaContainer* GetMediaContainer(std::string fullUrl);
+
+private:
+ const std::string USERAGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17";
+
+ Poco::Net::HTTPClientSession *m_pPlexSession = 0;
+ PlexServer *pServer = 0;
+ std::string m_sToken;
+
+ Poco::Net::HTTPClientSession* GetHttpSession(bool createNew = false);
+ Poco::Net::HTTPRequest* CreateRequest(std::string path);
+
+};
+
+}
+
+#endif // PLEXSERVICE_H