Skip to content

Commit 28788a0

Browse files
committed
rename uih and remove afiliate link foo
1 parent a1aaca1 commit 28788a0

59 files changed

Lines changed: 334 additions & 427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
44
import org.schabi.newpipe.extractor.exceptions.ParsingException;
5-
import org.schabi.newpipe.extractor.uih.UIHandler;
6-
import org.schabi.newpipe.extractor.uih.UIHandler;
5+
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
76

87
import javax.annotation.Nonnull;
98
import javax.annotation.Nullable;
@@ -16,26 +15,26 @@ public abstract class Extractor {
1615
*/
1716
private final StreamingService service;
1817

19-
private final org.schabi.newpipe.extractor.uih.UIHandler uIHandler;
18+
private final LinkHandler uIHandler;
2019

2120
@Nullable
2221
private boolean pageFetched = false;
2322
private final Downloader downloader;
2423

25-
public Extractor(final StreamingService service, final UIHandler uIHandler) {
24+
public Extractor(final StreamingService service, final LinkHandler uIHandler) {
2625
if(service == null) throw new NullPointerException("service is null");
27-
if(uIHandler == null) throw new NullPointerException("UIHandler is null");
26+
if(uIHandler == null) throw new NullPointerException("LinkHandler is null");
2827
this.service = service;
2928
this.uIHandler = uIHandler;
3029
this.downloader = NewPipe.getDownloader();
3130
if(downloader == null) throw new NullPointerException("downloader is null");
3231
}
3332

3433
/**
35-
* @return The {@link UIHandler} of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
34+
* @return The {@link LinkHandler} of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
3635
*/
3736
@Nonnull
38-
public UIHandler getUIHandler() {
37+
public LinkHandler getUIHandler() {
3938
return uIHandler;
4039
}
4140

extractor/src/main/java/org/schabi/newpipe/extractor/Info.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package org.schabi.newpipe.extractor;
22

3-
import org.schabi.newpipe.extractor.exceptions.ParsingException;
4-
import org.schabi.newpipe.extractor.uih.UIHFactory;
5-
import org.schabi.newpipe.extractor.uih.UIHandler;
3+
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
64

75
import java.io.Serializable;
86
import java.util.ArrayList;
@@ -20,7 +18,7 @@ public abstract class Info implements Serializable {
2018
/**
2119
* Different than the {@link #originalUrl} in the sense that it <i>may</i> be set as a cleaned url.
2220
*
23-
* @see UIHandler#getUrl()
21+
* @see LinkHandler#getUrl()
2422
* @see Extractor#getOriginalUrl()
2523
*/
2624
private final String url;
@@ -50,11 +48,11 @@ public Info(int serviceId, String id, String url, String originalUrl, String nam
5048
this.name = name;
5149
}
5250

53-
public Info(int serviceId, UIHandler uiHandler, String name) {
51+
public Info(int serviceId, LinkHandler linkHandler, String name) {
5452
this(serviceId,
55-
uiHandler.getId(),
56-
uiHandler.getUrl(),
57-
uiHandler.getOriginalUrl(),
53+
linkHandler.getId(),
54+
linkHandler.getUrl(),
55+
linkHandler.getOriginalUrl(),
5856
name);
5957
}
6058

extractor/src/main/java/org/schabi/newpipe/extractor/ListExtractor.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package org.schabi.newpipe.extractor;
22

33
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
4-
import org.schabi.newpipe.extractor.uih.ListUIHFactory;
5-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
4+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
65

76
import javax.annotation.Nonnull;
8-
import javax.swing.plaf.ListUI;
97
import java.io.IOException;
108
import java.util.Collections;
119
import java.util.List;
@@ -15,7 +13,7 @@
1513
*/
1614
public abstract class ListExtractor<R extends InfoItem> extends Extractor {
1715

18-
public ListExtractor(StreamingService service, ListUIHandler uiHandler) {
16+
public ListExtractor(StreamingService service, ListLinkHandler uiHandler) {
1917
super(service, uiHandler);
2018
}
2119

@@ -53,8 +51,8 @@ public boolean hasNextPage() throws IOException, ExtractionException {
5351
}
5452

5553
@Override
56-
public ListUIHandler getUIHandler() {
57-
return (ListUIHandler) super.getUIHandler();
54+
public ListLinkHandler getUIHandler() {
55+
return (ListLinkHandler) super.getUIHandler();
5856
}
5957

6058
/*//////////////////////////////////////////////////////////////////////////

extractor/src/main/java/org/schabi/newpipe/extractor/ListInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.schabi.newpipe.extractor;
22

3-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
3+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
44

55
import java.util.List;
66

@@ -22,7 +22,7 @@ public ListInfo(int serviceId,
2222
this.sortFilter = sortFilter;
2323
}
2424

25-
public ListInfo(int serviceId, ListUIHandler listUrlIdHandler, String name) {
25+
public ListInfo(int serviceId, ListLinkHandler listUrlIdHandler, String name) {
2626
super(serviceId, listUrlIdHandler, name);
2727
this.contentFilters = listUrlIdHandler.getContentFilters();
2828
this.sortFilter = listUrlIdHandler.getSortFilter();

extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.schabi.newpipe.extractor.kiosk.KioskList;
77
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
88
import org.schabi.newpipe.extractor.search.SearchExtractor;
9-
import org.schabi.newpipe.extractor.uih.*;
9+
import org.schabi.newpipe.extractor.linkhandler.*;
1010
import org.schabi.newpipe.extractor.stream.StreamExtractor;
1111
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
1212

@@ -67,23 +67,23 @@ public String toString() {
6767
////////////////////////////////////////////
6868
// Url Id handler
6969
////////////////////////////////////////////
70-
public abstract UIHFactory getStreamUIHFactory();
71-
public abstract ListUIHFactory getChannelUIHFactory();
72-
public abstract ListUIHFactory getPlaylistUIHFactory();
73-
public abstract SearchQIHFactory getSearchQIHFactory();
70+
public abstract LinkHandlerFactory getStreamUIHFactory();
71+
public abstract ListLinkHandlerFactory getChannelUIHFactory();
72+
public abstract ListLinkHandlerFactory getPlaylistUIHFactory();
73+
public abstract SearchQueryHandlerFactory getSearchQIHFactory();
7474

7575

7676
////////////////////////////////////////////
7777
// Extractor
7878
////////////////////////////////////////////
79-
public abstract SearchExtractor getSearchExtractor(SearchQIHandler queryHandler, String contentCountry);
79+
public abstract SearchExtractor getSearchExtractor(SearchQueryHandler queryHandler, String contentCountry);
8080
public abstract SuggestionExtractor getSuggestionExtractor();
8181
public abstract SubscriptionExtractor getSubscriptionExtractor();
8282
public abstract KioskList getKioskList() throws ExtractionException;
8383

84-
public abstract ChannelExtractor getChannelExtractor(ListUIHandler urlIdHandler) throws ExtractionException;
85-
public abstract PlaylistExtractor getPlaylistExtractor(ListUIHandler urlIdHandler) throws ExtractionException;
86-
public abstract StreamExtractor getStreamExtractor(UIHandler UIHFactory) throws ExtractionException;
84+
public abstract ChannelExtractor getChannelExtractor(ListLinkHandler urlIdHandler) throws ExtractionException;
85+
public abstract PlaylistExtractor getPlaylistExtractor(ListLinkHandler urlIdHandler) throws ExtractionException;
86+
public abstract StreamExtractor getStreamExtractor(LinkHandler UIHFactory) throws ExtractionException;
8787

8888
public SearchExtractor getSearchExtractor(String query, List<String> contentFilter, String sortFilter, String contentCountry) throws ExtractionException {
8989
return getSearchExtractor(getSearchQIHFactory().fromQuery(query, contentFilter, sortFilter), contentCountry);
@@ -119,9 +119,9 @@ public StreamExtractor getStreamExtractor(String url) throws ExtractionException
119119
* figure out where the link is pointing to (a channel, video, playlist, etc.)
120120
*/
121121
public final LinkType getLinkTypeByUrl(String url) throws ParsingException {
122-
UIHFactory sH = getStreamUIHFactory();
123-
UIHFactory cH = getChannelUIHFactory();
124-
UIHFactory pH = getPlaylistUIHFactory();
122+
LinkHandlerFactory sH = getStreamUIHFactory();
123+
LinkHandlerFactory cH = getChannelUIHFactory();
124+
LinkHandlerFactory pH = getPlaylistUIHFactory();
125125

126126
if (sH.acceptUrl(url)) {
127127
return LinkType.STREAM;

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.schabi.newpipe.extractor.StreamingService;
55
import org.schabi.newpipe.extractor.exceptions.ParsingException;
66
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
7-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
7+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
88

99
/*
1010
* Created by Christian Schabesberger on 25.07.16.
@@ -28,7 +28,7 @@
2828

2929
public abstract class ChannelExtractor extends ListExtractor<StreamInfoItem> {
3030

31-
public ChannelExtractor(StreamingService service, ListUIHandler urlIdHandler) {
31+
public ChannelExtractor(StreamingService service, ListLinkHandler urlIdHandler) {
3232
super(service, urlIdHandler);
3333
}
3434

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfo.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
44
import org.schabi.newpipe.extractor.ListInfo;
5-
import org.schabi.newpipe.extractor.uih.ListUIHFactory;
65
import org.schabi.newpipe.extractor.NewPipe;
76
import org.schabi.newpipe.extractor.StreamingService;
87
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
98
import org.schabi.newpipe.extractor.exceptions.ParsingException;
109
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
11-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
10+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
1211
import org.schabi.newpipe.extractor.utils.ExtractorHelper;
1312

1413
import java.io.IOException;
@@ -35,7 +34,7 @@
3534

3635
public class ChannelInfo extends ListInfo<StreamInfoItem> {
3736

38-
public ChannelInfo(int serviceId, ListUIHandler urlIdHandler, String name) throws ParsingException {
37+
public ChannelInfo(int serviceId, ListLinkHandler urlIdHandler, String name) throws ParsingException {
3938
super(serviceId, urlIdHandler, name);
4039
}
4140

extractor/src/main/java/org/schabi/newpipe/extractor/kiosk/KioskExtractor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
*/
2222

2323
import org.schabi.newpipe.extractor.ListExtractor;
24-
import org.schabi.newpipe.extractor.uih.ListUIHFactory;
2524
import org.schabi.newpipe.extractor.StreamingService;
2625
import org.schabi.newpipe.extractor.exceptions.ParsingException;
2726
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
28-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
27+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
2928

3029
import javax.annotation.Nonnull;
3130

@@ -34,7 +33,7 @@ public abstract class KioskExtractor extends ListExtractor<StreamInfoItem> {
3433
private final String id;
3534

3635
public KioskExtractor(StreamingService streamingService,
37-
ListUIHandler urlIdHandler,
36+
ListLinkHandler urlIdHandler,
3837
String kioskId) {
3938
super(streamingService, urlIdHandler);
4039
this.id = kioskId;

extractor/src/main/java/org/schabi/newpipe/extractor/kiosk/KioskInfo.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@
2424
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
2525
import org.schabi.newpipe.extractor.exceptions.ParsingException;
2626
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
27-
import org.schabi.newpipe.extractor.uih.ListUIHFactory;
28-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
27+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
2928
import org.schabi.newpipe.extractor.utils.ExtractorHelper;
3029

3130
import java.io.IOException;
3231

3332
public class KioskInfo extends ListInfo<StreamInfoItem> {
3433

35-
private KioskInfo(int serviceId, ListUIHandler urlIdHandler, String name) throws ParsingException {
34+
private KioskInfo(int serviceId, ListLinkHandler urlIdHandler, String name) throws ParsingException {
3635
super(serviceId, urlIdHandler, name);
3736
}
3837

extractor/src/main/java/org/schabi/newpipe/extractor/kiosk/KioskList.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import org.schabi.newpipe.extractor.NewPipe;
44
import org.schabi.newpipe.extractor.StreamingService;
5-
import org.schabi.newpipe.extractor.uih.ListUIHFactory;
6-
import org.schabi.newpipe.extractor.uih.ListUIHandler;
7-
import org.schabi.newpipe.extractor.uih.UIHFactory;
5+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
86
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
97

108
import java.io.IOException;
@@ -25,19 +23,19 @@ KioskExtractor createNewKiosk(final StreamingService streamingService,
2523
private String defaultKiosk = null;
2624

2725
private class KioskEntry {
28-
public KioskEntry(KioskExtractorFactory ef, ListUIHFactory h) {
26+
public KioskEntry(KioskExtractorFactory ef, ListLinkHandlerFactory h) {
2927
extractorFactory = ef;
3028
handlerFactory = h;
3129
}
3230
final KioskExtractorFactory extractorFactory;
33-
final ListUIHFactory handlerFactory;
31+
final ListLinkHandlerFactory handlerFactory;
3432
}
3533

3634
public KioskList(int service_id) {
3735
this.service_id = service_id;
3836
}
3937

40-
public void addKioskEntry(KioskExtractorFactory extractorFactory, ListUIHFactory handlerFactory, String id)
38+
public void addKioskEntry(KioskExtractorFactory extractorFactory, ListLinkHandlerFactory handlerFactory, String id)
4139
throws Exception {
4240
if(kioskList.get(id) != null) {
4341
throw new Exception("Kiosk with type " + id + " already exists.");
@@ -94,7 +92,7 @@ public KioskExtractor getExtractorByUrl(String url, String nextPageUrl)
9492
throw new ExtractionException("Could not find a kiosk that fits to the url: " + url);
9593
}
9694

97-
public ListUIHFactory getUIHFactoryByType(String type) {
95+
public ListLinkHandlerFactory getUIHFactoryByType(String type) {
9896
return kioskList.get(type).handlerFactory;
9997
}
10098
}

0 commit comments

Comments
 (0)