Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lasers
NewPipeExtractor
Commits
f3087553
Commit
f3087553
authored
Sep 09, 2017
by
Christian Schabesberger
Browse files
try YoutubeChannelExtractor.getName() hack try 2
parent
a6da2024
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java
View file @
f3087553
...
...
@@ -93,7 +93,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
@Override
public
String
getName
()
throws
ParsingException
{
try
{
return
doc
.
select
(
"span[class=\"qualified-channel-title-text\"]"
).
first
().
select
(
"a"
).
first
().
text
();
channelName
=
doc
.
select
(
"span[class=\"qualified-channel-title-text\"]"
).
first
().
select
(
"a"
).
first
().
text
();
return
channelName
;
}
catch
(
Exception
e
)
{
throw
new
ParsingException
(
"Could not get channel name"
,
e
);
}
...
...
@@ -102,8 +103,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
@Override
public
String
getAvatarUrl
()
throws
ParsingException
{
try
{
channelName
=
doc
.
select
(
"img[class=\"channel-header-profile-image\"]"
).
first
().
attr
(
"abs:src"
);
return
channelName
;
return
doc
.
select
(
"img[class=\"channel-header-profile-image\"]"
).
first
().
attr
(
"abs:src"
);
}
catch
(
Exception
e
)
{
throw
new
ParsingException
(
"Could not get avatar"
,
e
);
}
...
...
src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java
View file @
f3087553
...
...
@@ -6,6 +6,7 @@ import org.schabi.newpipe.Downloader;
import
org.schabi.newpipe.extractor.ListExtractor
;
import
org.schabi.newpipe.extractor.NewPipe
;
import
org.schabi.newpipe.extractor.channel.ChannelExtractor
;
import
org.schabi.newpipe.extractor.stream.StreamInfoItem
;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
schabi
.
newpipe
.
extractor
.
ServiceList
.
YouTube
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment