refactor YoutubeAPI

This commit is contained in:
mrbesen 2021-10-18 21:32:08 +02:00
parent 2df0029c18
commit bdcc276d58
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 2 additions and 17 deletions

View File

@ -38,25 +38,11 @@ public class YoutubeAPI {
}
}
public YoutubeAPI() {
if(api_key.isEmpty()) {
log.error("apikey is not defined!");
System.exit(1);
}
try {
durationfactory = DatatypeFactory.newInstance();
} catch(DatatypeConfigurationException e) {
e.printStackTrace();
System.exit(1);
}
}
public Crawler.Video getInfo(String id) {
return (Crawler.Video) getInfos(id)[0].get(0);
return getInfos(id)[0].get(0);
}
public List<Crawler.Video>[] getInfos(List<String> ids) {
//log.info("get " + ids.size() + " infos");
if(ids.isEmpty())
return null;
@ -174,5 +160,4 @@ public class YoutubeAPI {
return null;
return new JSONObject(new JSONTokener(in));
}
}
// no suchelement bla
}