16 #include <QTextStream>
44 return QStringList(
"/InternetContent" );
57 if (pRequest->
m_sBaseUrl !=
"/InternetContent")
60 LOG(VB_UPNP, LOG_INFO,
61 QString(
"InternetContent::ProcessRequest: %1 : %2")
67 if (pRequest->
m_sMethod ==
"GetInternetSearch")
75 if (pRequest->
m_sMethod ==
"GetInternetSources")
83 if (pRequest->
m_sMethod ==
"GetInternetContent")
92 LOG(VB_GENERAL, LOG_ERR,
93 "InternetContent::ProcessRequest() - Unexpected Exception" );
111 QString grabber = pRequest->
m_mapParams[
"Grabber" ];
115 if (grabber.isEmpty() || query.isEmpty())
118 QString command = QString(
"%1internetcontent/%2")
124 "not exist!</HTML>").arg(command) );
128 auto *search =
new Search();
136 search->executeSearch(command, query, page);
142 ret.setContent(search->GetData());
161 QString GrabberDir = QString(
"%1/internetcontent/").arg(
GetShareDir());
162 QDir GrabberPath(GrabberDir);
163 QStringList Grabbers = GrabberPath.entryList(QDir::Files | QDir::Executable);
165 for (
const auto & name : std::as_const(Grabbers))
167 QString commandline = GrabberDir + name;
172 QByteArray result = scriptcheck.
ReadAll();
174 if (!result.isEmpty() && result.toLower().startsWith(
"<grabber>"))
180 list.push_back(
NameValue(
"InternetContent", ret ));
193 QString grabber = pRequest->
m_mapParams[
"Grabber" ];
195 if (grabber.isEmpty())
198 QString contentDir = QString(
"%1internetcontent/").arg(
GetShareDir());
199 QString htmlFile(contentDir + grabber);
202 QFileInfo fileInfo(htmlFile);
203 if (fileInfo.canonicalFilePath().startsWith(contentDir) &&
213 "not exist!</HTML>").arg(htmlFile) );