|
1 | 1 | package org.schabi.newpipe.extractor.services.media_ccc.extractors; |
2 | 2 |
|
3 | 3 | import com.grack.nanojson.JsonObject; |
4 | | - |
5 | | -import org.schabi.newpipe.extractor.ServiceList; |
6 | | -import org.schabi.newpipe.extractor.channel.ChannelExtractor; |
7 | | -import org.schabi.newpipe.extractor.exceptions.ExtractionException; |
8 | 4 | import org.schabi.newpipe.extractor.exceptions.ParsingException; |
9 | 5 | import org.schabi.newpipe.extractor.localization.DateWrapper; |
10 | 6 | import org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCConferenceLinkHandlerFactory; |
11 | 7 | import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor; |
12 | 8 | import org.schabi.newpipe.extractor.stream.StreamType; |
13 | 9 |
|
14 | | -import java.io.IOException; |
| 10 | +import javax.annotation.Nullable; |
15 | 11 | import java.time.ZonedDateTime; |
16 | 12 | import java.time.format.DateTimeFormatter; |
17 | | -import java.util.Map; |
18 | | - |
19 | | -import javax.annotation.Nullable; |
20 | | - |
21 | | -import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; |
22 | 13 |
|
23 | 14 | public class MediaCCCRecentKioskExtractor implements StreamInfoItemExtractor { |
24 | 15 |
|
25 | 16 | private final JsonObject event; |
26 | | - private final Map<String, String> conferenceNames; |
27 | 17 |
|
28 | | - public MediaCCCRecentKioskExtractor(final JsonObject event, |
29 | | - final Map<String, String> conferenceNames) { |
| 18 | + public MediaCCCRecentKioskExtractor(final JsonObject event) { |
30 | 19 | this.event = event; |
31 | | - this.conferenceNames = conferenceNames; |
32 | 20 | } |
33 | 21 |
|
34 | 22 | @Override |
@@ -68,25 +56,7 @@ public long getViewCount() throws ParsingException { |
68 | 56 |
|
69 | 57 | @Override |
70 | 58 | public String getUploaderName() throws ParsingException { |
71 | | - final String conferenceApiUrl = event.getString("conference_url"); |
72 | | - if (isNullOrEmpty(conferenceApiUrl)) { |
73 | | - throw new ParsingException("conference url is empty"); |
74 | | - } |
75 | | - |
76 | | - if (conferenceNames.containsKey(conferenceApiUrl)) { |
77 | | - return conferenceNames.get(conferenceApiUrl); |
78 | | - } |
79 | | - |
80 | | - // get conference name from API. |
81 | | - try { |
82 | | - ChannelExtractor extractor = ServiceList.MediaCCC.getChannelExtractor( |
83 | | - new MediaCCCConferenceLinkHandlerFactory().fromUrl(conferenceApiUrl)); |
84 | | - extractor.fetchPage(); |
85 | | - conferenceNames.put(conferenceApiUrl, extractor.getName()); |
86 | | - return extractor.getName(); |
87 | | - } catch (IOException | ExtractionException e) { |
88 | | - throw new ParsingException("Could not get conference name from conference API URL", e); |
89 | | - } |
| 59 | + return ""; |
90 | 60 | } |
91 | 61 |
|
92 | 62 | @Override |
|
0 commit comments