void *query_pt4::setup_curl(const po::variables_map& vm) const { CURL *c; quvi_getinfo(_quvi, QUVIINFO_CURL, &c); cc::curl_setup(c, vm); return c; }
QuviMediaInfo::QuviMediaInfo(std::wstring&& url) : m_ourl(std::move(url)) , m_qp(m_q, m_ourl) { QUVIcode qc; char* infoUrl = nullptr; qc = quvi_getprop(m_qp, QUVIPROP_MEDIAURL, &infoUrl); if (qc != QUVI_OK || !infoUrl) throw qc; m_url = WideFromMultibyte(infoUrl); m_murl = infoUrl; char* infoTitle = nullptr; qc = quvi_getprop(m_qp, QUVIPROP_PAGETITLE, &infoTitle); if (qc == QUVI_OK && infoTitle) { // not nice to expect the page to be encoded in utf-8, but quvi doesn't leave much choice std::wstring_convert<std::codecvt_utf8<wchar_t>> convert; m_title = convert.from_bytes(infoTitle); } char* infoContentType = nullptr; qc = quvi_getprop(m_qp, QUVIPROP_MEDIACONTENTTYPE, &infoContentType); if (qc == QUVI_OK && infoContentType) m_contentType = infoContentType; double len = 0; qc = quvi_getprop(m_qp, QUVIPROP_MEDIACONTENTLENGTH, &len); if (qc == QUVI_OK && len > 0) m_contentLength = (uint64_t)len; qc = quvi_getinfo(m_q, QUVIINFO_CURL, &m_curl); if (qc != QUVI_OK || !m_curl) throw qc; }
void error_pt4::_init(quvi_t q) { _what = quvi_strerror(q, static_cast<QUVIcode>(_quvi_code)); quvi_getinfo(q, QUVIINFO_RESPONSECODE, &_resp_code); }