本文整理了Java中org.tinymediamanager.scraper.http.Url.getInputStream()
方法的一些代码示例,展示了Url.getInputStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Url.getInputStream()
方法的具体详情如下:
包路径:org.tinymediamanager.scraper.http.Url
类名称:Url
方法名:getInputStream
[英]Gets the input stream.
[中]获取输入流。
代码示例来源:origin: org.tinymediamanager/api-scraper
/**
* Gets the bytes.
*
* @return the bytes
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public byte[] getBytes() throws IOException, InterruptedException {
InputStream is = getInputStream();
byte[] bytes = IOUtils.toByteArray(is);
IOUtils.closeQuietly(is);
return bytes;
}
代码示例来源:origin: org.tinymediamanager/api-scraper
/**
* Download an Url to a file via NIO FileChannel (synchron)
*
* @param file
* @return successful or not
*/
public boolean download(File file) {
try {
InputStream is = getInputStream();
if (is == null) {
return false;
}
ReadableByteChannel rbc = Channels.newChannel(is);
FileOutputStream fos = new FileOutputStream(file);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
return true;
}
catch (IOException e) {
LOGGER.error("Error downloading " + this.url);
}
catch (InterruptedException ignored) {
if (call != null) {
call.cancel();
}
}
return false;
}
代码示例来源:origin: tinyMediaManager/tinyMediaManager
Url jsPlayer = new Url("https:" + matcher.group(1).replaceAll("\\\\", ""));
StringWriter writer = new StringWriter();
IOUtils.copy(jsPlayer.getInputStream(), writer, "UTF-8");
playerJavascript = writer.toString();
代码示例来源:origin: org.tinymediamanager/api-scraper
InputStream is = url.getInputStream();
if (is == null) {
return null;
代码示例来源:origin: org.tinymediamanager/api-scraper
counter++;
try {
is = getInputStream();
代码示例来源:origin: org.tinymediamanager.plugins/scraper-imdb
@Override
public Document call() throws Exception {
doc = null;
try {
Url url = new Url(this.url);
url.addHeader("Accept-Language", getAcceptLanguage(language, country));
doc = Jsoup.parse(url.getInputStream(), imdbSite.getCharset().displayName(), "");
}
catch (Exception e) {
getLogger().debug("tried to fetch imdb page " + url, e);
}
return doc;
}
}
代码示例来源:origin: org.tinymediamanager.plugins/scraper-kodi
LOGGER.debug("Converting ZipFile to Text content for url: " + urlString);
ZipInputStream zis = new ZipInputStream(u.getInputStream());
ZipEntry ze = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
return u.getInputStream();
代码示例来源:origin: tinyMediaManager/tinyMediaManager
Url jsonConfigUrl = new Url(youtubeUrl + "&spf=prefetch");
StringWriter writer = new StringWriter();
IOUtils.copy(jsonConfigUrl.getInputStream(), writer, "UTF-8");
jsonConfiguration = writer.toString();
代码示例来源:origin: tinyMediaManager/tinyMediaManager
remoteDigest = IOUtils.toString(upd.getInputStream(), "UTF-8");
if (remoteDigest != null && remoteDigest.contains("tmm.jar")) {
remoteDigest = remoteDigest.trim();
String remoteGD = IOUtils.toString(gd.getInputStream(), "UTF-8");
if (remoteGD.contains("forceUpdate")) {
forceUpdate = true;
changelog = IOUtils.toString(upd.getInputStream(), "UTF-8");
return true;
InputStream is = upd.getInputStream();
if (is == null) {
throw new Exception("Server returned " + upd.getStatusCode() + "\nIf this error persists, please check forum!");
代码示例来源:origin: tinyMediaManager/tinyMediaManager
InputStream is = url1.getInputStream();
IOUtils.copy(is, outputStream);
outputStream.close();
代码示例来源:origin: org.tinymediamanager/api-scraper
try {
Url url = new CachedUrl(searchUrl);
InputStream in = url.getInputStream();
doc = Jsoup.parse(in, PAGE_ENCODING, "");
in.close();
代码示例来源:origin: org.tinymediamanager.plugins/scraper-zelluloid
try {
Url url = new CachedUrl(searchUrl);
InputStream in = url.getInputStream();
doc = Jsoup.parse(in, PAGE_ENCODING, "");
in.close();
代码示例来源:origin: tinyMediaManager/tinyMediaManager
InputStream is = url.getInputStream();
if (url.isFault()) {
return;
代码示例来源:origin: org.tinymediamanager.plugins/scraper-hdtrailers
InputStream in = url.getInputStream();
if (in == null) {
return trailers;
代码示例来源:origin: org.tinymediamanager.plugins/scraper-ofdb
InputStream in = url.getInputStream();
Document doc = Jsoup.parse(in, "UTF-8", "");
in.close();
in = url.getInputStream();
doc = Jsoup.parse(in, "UTF-8", "");
in.close();
代码示例来源:origin: org.tinymediamanager.plugins/scraper-imdb
Url url = new Url(sb.toString());
url.addHeader("Accept-Language", getAcceptLanguage(language, country));
doc = Jsoup.parse(url.getInputStream(), "UTF-8", "");
代码示例来源:origin: org.tinymediamanager.plugins/scraper-ofdb
InputStream in = url.getInputStream();
Document doc = Jsoup.parse(in, "UTF-8", "");
in.close();
InputStream in = url.getInputStream();
Document doc = Jsoup.parse(in, "UTF-8", "");
in.close();
代码示例来源:origin: org.tinymediamanager.plugins/scraper-zelluloid
try {
Url url = new CachedUrl(searchUrl);
InputStream in = url.getInputStream();
doc = Jsoup.parse(in, PAGE_ENCODING, "");
in.close();
代码示例来源:origin: org.tinymediamanager.plugins/scraper-imdb
Url url = new Url(imdbSite.getSite() + "/title/" + wantedEpisode.ids.get(providerInfo.getId()) + "/fullcredits");
url.addHeader("Accept-Language", "en"); // force EN for parsing by HTMl texts
Document doc = Jsoup.parse(url.getInputStream(), imdbSite.getCharset().displayName(), "");
代码示例来源:origin: org.tinymediamanager.plugins/scraper-ofdb
LOGGER.trace("get details page");
url = new Url(detailUrl);
InputStream in = url.getInputStream();
Document doc = Jsoup.parse(in, "UTF-8", "");
in.close();
try {
url = new Url(plotUrl);
in = url.getInputStream();
Document plot = Jsoup.parse(in, "UTF-8", "");
in.close();
try {
url = new Url(movieDetail);
in = url.getInputStream();
doc = Jsoup.parse(in, "UTF-8", "");
in.close();
内容来源于网络,如有侵权,请联系作者删除!