mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Update close for try witch resources
This commit is contained in:
parent
84f4760349
commit
f3042b6b45
@ -133,10 +133,9 @@ public class YoutubeManager {
|
|||||||
|
|
||||||
InputStream is = conn.getInputStream();
|
InputStream is = conn.getInputStream();
|
||||||
InputStreamReader isr = new InputStreamReader(is);
|
InputStreamReader isr = new InputStreamReader(is);
|
||||||
BufferedReader br = new BufferedReader(isr);
|
YoutubePlaylist playlist;
|
||||||
|
try (BufferedReader br = new BufferedReader(isr)) {
|
||||||
YoutubePlaylist playlist = null;
|
playlist = null;
|
||||||
|
|
||||||
String inputLine;
|
String inputLine;
|
||||||
while ((inputLine = br.readLine()) != null) {
|
while ((inputLine = br.readLine()) != null) {
|
||||||
if (inputLine.contains("window[\"ytInitialData\"]")) {
|
if (inputLine.contains("window[\"ytInitialData\"]")) {
|
||||||
@ -161,8 +160,7 @@ public class YoutubeManager {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
br.close();
|
|
||||||
|
|
||||||
this.playlistCache.put(playlistId, playlist);
|
this.playlistCache.put(playlistId, playlist);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user