Skip to content

Commit 03634a2

Browse files
committed
Rollback classes naming
1 parent 8d88093 commit 03634a2

40 files changed

Lines changed: 403 additions & 397 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.gradle
2-
/build/
2+
build/
33
.idea
44
local.properties
5+
out/
56

67
# Ignore Gradle GUI config
78
gradle-app.setting

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public abstract class Extractor {
2020
* <pre>
2121
* https://www.youtube.com/watch?v=a9Zf_258aTI<i>&t=4s</i> → <i><b>&t=4s</b></i>
2222
* </pre>
23-
* But as you can imagine, the time parameter is very important when calling, for example, {@link org.schabi.newpipe.extractor.stream.StreamExtractor#getTimeStamp()}.
23+
* But as you can imagine, the time parameter is very important when calling {@link org.schabi.newpipe.extractor.stream.StreamExtractor#getTimeStamp()}.
2424
*/
2525
private final String originalUrl;
2626

@@ -37,7 +37,7 @@ public Extractor(StreamingService service, String url) throws ExtractionExceptio
3737
}
3838

3939
/**
40-
* @return a {@link UrlIdHandler} of the current extractor type (e.g. a UserExtractor should return a user url handler).
40+
* @return a {@link UrlIdHandler} of the current extractor type (e.g. a ChannelExtractor should return a channel url handler).
4141
*/
4242
protected abstract UrlIdHandler getUrlIdHandler() throws ParsingException;
4343

@@ -46,6 +46,9 @@ public Extractor(StreamingService service, String url) throws ExtractionExceptio
4646
*/
4747
public abstract void fetchPage() throws IOException, ExtractionException;
4848

49+
public abstract String getId() throws ParsingException;
50+
public abstract String getName() throws ParsingException;
51+
4952
public String getOriginalUrl() {
5053
return originalUrl;
5154
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public abstract class InfoItem implements Serializable {
2626
public enum InfoType {
2727
STREAM,
2828
PLAYLIST,
29-
USER
29+
CHANNEL
3030
}
3131

3232
public final InfoType info_type;

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
55
import org.schabi.newpipe.extractor.search.SearchEngine;
66
import org.schabi.newpipe.extractor.stream.StreamExtractor;
7-
import org.schabi.newpipe.extractor.user.UserExtractor;
7+
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
88

99
import java.io.IOException;
1010

@@ -20,7 +20,7 @@ public ServiceInfo(String name) {
2020
public enum LinkType {
2121
NONE,
2222
STREAM,
23-
USER,
23+
CHANNEL,
2424
PLAYLIST
2525
}
2626

@@ -41,34 +41,34 @@ public ServiceInfo getServiceInfo() {
4141
}
4242

4343
public abstract UrlIdHandler getStreamUrlIdHandler();
44-
public abstract UrlIdHandler getUserUrlIdHandler();
44+
public abstract UrlIdHandler getChannelUrlIdHandler();
4545
public abstract UrlIdHandler getPlaylistUrlIdHandler();
4646
public abstract SearchEngine getSearchEngine();
4747
public abstract SuggestionExtractor getSuggestionExtractor();
4848
public abstract StreamExtractor getStreamExtractor(String url) throws IOException, ExtractionException;
49-
public abstract UserExtractor getUserExtractor(String url, String nextStreamsUrl) throws IOException, ExtractionException;
49+
public abstract ChannelExtractor getChannelExtractor(String url, String nextStreamsUrl) throws IOException, ExtractionException;
5050
public abstract PlaylistExtractor getPlaylistExtractor(String url, String nextStreamsUrl) throws IOException, ExtractionException;
5151

52-
public UserExtractor getUserExtractor(String url) throws IOException, ExtractionException {
53-
return getUserExtractor(url, null);
52+
public ChannelExtractor getChannelExtractor(String url) throws IOException, ExtractionException {
53+
return getChannelExtractor(url, null);
5454
}
5555

5656
public PlaylistExtractor getPlaylistExtractor(String url) throws IOException, ExtractionException {
5757
return getPlaylistExtractor(url, null);
5858
}
5959

6060
/**
61-
* figure out where the link is pointing to (a user, video, playlist, etc.)
61+
* figure out where the link is pointing to (a channel, video, playlist, etc.)
6262
*/
6363
public final LinkType getLinkTypeByUrl(String url) {
6464
UrlIdHandler sH = getStreamUrlIdHandler();
65-
UrlIdHandler cH = getUserUrlIdHandler();
65+
UrlIdHandler cH = getChannelUrlIdHandler();
6666
UrlIdHandler pH = getPlaylistUrlIdHandler();
6767

6868
if (sH.acceptUrl(url)) {
6969
return LinkType.STREAM;
7070
} else if (cH.acceptUrl(url)) {
71-
return LinkType.USER;
71+
return LinkType.CHANNEL;
7272
} else if (pH.acceptUrl(url)) {
7373
return LinkType.PLAYLIST;
7474
} else {

src/main/java/org/schabi/newpipe/extractor/user/UserExtractor.java renamed to src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.schabi.newpipe.extractor.user;
1+
package org.schabi.newpipe.extractor.channel;
22

33
import org.schabi.newpipe.extractor.ListExtractor;
44
import org.schabi.newpipe.extractor.StreamingService;
@@ -12,7 +12,7 @@
1212
* Created by Christian Schabesberger on 25.07.16.
1313
*
1414
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
15-
* UserExtractor.java is part of NewPipe.
15+
* ChannelExtractor.java is part of NewPipe.
1616
*
1717
* NewPipe is free software: you can redistribute it and/or modify
1818
* it under the terms of the GNU General Public License as published by
@@ -28,19 +28,17 @@
2828
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
2929
*/
3030

31-
public abstract class UserExtractor extends ListExtractor {
31+
public abstract class ChannelExtractor extends ListExtractor {
3232

33-
public UserExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
33+
public ChannelExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
3434
super(service, url, nextStreamsUrl);
3535
}
3636

3737
@Override
3838
protected UrlIdHandler getUrlIdHandler() throws ParsingException {
39-
return getService().getUserUrlIdHandler();
39+
return getService().getChannelUrlIdHandler();
4040
}
4141

42-
public abstract String getUserId() throws ParsingException;
43-
public abstract String getUserName() throws ParsingException;
4442
public abstract String getAvatarUrl() throws ParsingException;
4543
public abstract String getBannerUrl() throws ParsingException;
4644
public abstract String getFeedUrl() throws ParsingException;

src/main/java/org/schabi/newpipe/extractor/user/UserInfo.java renamed to src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfo.java

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

33
import org.schabi.newpipe.extractor.ListExtractor.NextItemsResult;
44
import org.schabi.newpipe.extractor.ListInfo;
@@ -16,7 +16,7 @@
1616
* Created by Christian Schabesberger on 31.07.16.
1717
*
1818
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
19-
* UserInfo.java is part of NewPipe.
19+
* ChannelInfo.java is part of NewPipe.
2020
*
2121
* NewPipe is free software: you can redistribute it and/or modify
2222
* it under the terms of the GNU General Public License as published by
@@ -32,36 +32,36 @@
3232
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
3333
*/
3434

35-
public class UserInfo extends ListInfo {
35+
public class ChannelInfo extends ListInfo {
3636

3737
public static NextItemsResult getMoreItems(ServiceList serviceItem, String nextStreamsUrl) throws IOException, ExtractionException {
3838
return getMoreItems(serviceItem.getService(), nextStreamsUrl);
3939
}
4040

4141
public static NextItemsResult getMoreItems(StreamingService service, String nextStreamsUrl) throws IOException, ExtractionException {
42-
return service.getUserExtractor(null, nextStreamsUrl).getNextStreams();
42+
return service.getChannelExtractor(null, nextStreamsUrl).getNextStreams();
4343
}
4444

45-
public static UserInfo getInfo(String url) throws IOException, ExtractionException {
45+
public static ChannelInfo getInfo(String url) throws IOException, ExtractionException {
4646
return getInfo(NewPipe.getServiceByUrl(url), url);
4747
}
4848

49-
public static UserInfo getInfo(ServiceList serviceItem, String url) throws IOException, ExtractionException {
49+
public static ChannelInfo getInfo(ServiceList serviceItem, String url) throws IOException, ExtractionException {
5050
return getInfo(serviceItem.getService(), url);
5151
}
5252

53-
public static UserInfo getInfo(StreamingService service, String url) throws IOException, ExtractionException {
54-
return getInfo(service.getUserExtractor(url));
53+
public static ChannelInfo getInfo(StreamingService service, String url) throws IOException, ExtractionException {
54+
return getInfo(service.getChannelExtractor(url));
5555
}
5656

57-
public static UserInfo getInfo(UserExtractor extractor) throws ParsingException {
58-
UserInfo info = new UserInfo();
57+
public static ChannelInfo getInfo(ChannelExtractor extractor) throws ParsingException {
58+
ChannelInfo info = new ChannelInfo();
5959

6060
// important data
6161
info.service_id = extractor.getServiceId();
6262
info.url = extractor.getCleanUrl();
63-
info.id = extractor.getUserId();
64-
info.name = extractor.getUserName();
63+
info.id = extractor.getId();
64+
info.name = extractor.getName();
6565

6666
try {
6767
info.avatar_url = extractor.getAvatarUrl();

src/main/java/org/schabi/newpipe/extractor/user/UserInfoItem.java renamed to src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItem.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package org.schabi.newpipe.extractor.user;
1+
package org.schabi.newpipe.extractor.channel;
22

33
import org.schabi.newpipe.extractor.InfoItem;
44

55
/*
66
* Created by Christian Schabesberger on 11.02.17.
77
*
88
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
9-
* UserInfoItem.java is part of NewPipe.
9+
* ChannelInfoItem.java is part of NewPipe.
1010
*
1111
* NewPipe is free software: you can redistribute it and/or modify
1212
* it under the terms of the GNU General Public License as published by
@@ -22,14 +22,14 @@
2222
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
2323
*/
2424

25-
public class UserInfoItem extends InfoItem {
25+
public class ChannelInfoItem extends InfoItem {
2626

2727
public String thumbnail_url;
2828
public String description;
2929
public long subscriber_count = -1;
3030
public long stream_count = -1;
3131

32-
public UserInfoItem() {
33-
super(InfoType.USER);
32+
public ChannelInfoItem() {
33+
super(InfoType.CHANNEL);
3434
}
3535
}

src/main/java/org/schabi/newpipe/extractor/user/UserInfoItemCollector.java renamed to src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemCollector.java

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

33
import org.schabi.newpipe.extractor.InfoItemCollector;
44
import org.schabi.newpipe.extractor.exceptions.ParsingException;
@@ -7,7 +7,7 @@
77
* Created by Christian Schabesberger on 12.02.17.
88
*
99
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
10-
* UserInfoItemCollector.java is part of NewPipe.
10+
* ChannelInfoItemCollector.java is part of NewPipe.
1111
*
1212
* NewPipe is free software: you can redistribute it and/or modify
1313
* it under the terms of the GNU General Public License as published by
@@ -23,16 +23,16 @@
2323
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
2424
*/
2525

26-
public class UserInfoItemCollector extends InfoItemCollector {
27-
public UserInfoItemCollector(int serviceId) {
26+
public class ChannelInfoItemCollector extends InfoItemCollector {
27+
public ChannelInfoItemCollector(int serviceId) {
2828
super(serviceId);
2929
}
3030

31-
public UserInfoItem extract(UserInfoItemExtractor extractor) throws ParsingException {
32-
UserInfoItem resultItem = new UserInfoItem();
31+
public ChannelInfoItem extract(ChannelInfoItemExtractor extractor) throws ParsingException {
32+
ChannelInfoItem resultItem = new ChannelInfoItem();
3333
// important information
3434
resultItem.service_id = getServiceId();
35-
resultItem.name = extractor.getUserName();
35+
resultItem.name = extractor.getChannelName();
3636
resultItem.url = extractor.getWebPageUrl();
3737

3838
// optional information
@@ -59,7 +59,7 @@ public UserInfoItem extract(UserInfoItemExtractor extractor) throws ParsingExcep
5959
return resultItem;
6060
}
6161

62-
public void commit(UserInfoItemExtractor extractor) throws ParsingException {
62+
public void commit(ChannelInfoItemExtractor extractor) throws ParsingException {
6363
try {
6464
addItem(extract(extractor));
6565
} catch (Exception e) {

src/main/java/org/schabi/newpipe/extractor/user/UserInfoItemExtractor.java renamed to src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemExtractor.java

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

33
import org.schabi.newpipe.extractor.exceptions.ParsingException;
44

55
/*
66
* Created by Christian Schabesberger on 12.02.17.
77
*
88
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
9-
* UserInfoItemExtractor.java is part of NewPipe.
9+
* ChannelInfoItemExtractor.java is part of NewPipe.
1010
*
1111
* NewPipe is free software: you can redistribute it and/or modify
1212
* it under the terms of the GNU General Public License as published by
@@ -22,9 +22,9 @@
2222
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
2323
*/
2424

25-
public interface UserInfoItemExtractor {
25+
public interface ChannelInfoItemExtractor {
2626
String getThumbnailUrl() throws ParsingException;
27-
String getUserName() throws ParsingException;
27+
String getChannelName() throws ParsingException;
2828
String getWebPageUrl() throws ParsingException;
2929
String getDescription() throws ParsingException;
3030
long getSubscriberCount() throws ParsingException;

src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ protected UrlIdHandler getUrlIdHandler() throws ParsingException {
1919
return getService().getPlaylistUrlIdHandler();
2020
}
2121

22-
public abstract String getPlaylistId() throws ParsingException;
23-
public abstract String getPlaylistName() throws ParsingException;
2422
public abstract String getThumbnailUrl() throws ParsingException;
2523
public abstract String getBannerUrl() throws ParsingException;
24+
2625
public abstract String getUploaderUrl() throws ParsingException;
2726
public abstract String getUploaderName() throws ParsingException;
2827
public abstract String getUploaderAvatarUrl() throws ParsingException;
28+
2929
public abstract long getStreamCount() throws ParsingException;
3030
}

0 commit comments

Comments
 (0)