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
e9156ee4
Commit
e9156ee4
authored
Sep 11, 2017
by
Mauricio Colli
Browse files
Fix parsing of SoundCloud stream info items
parent
0c632e19
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java
View file @
e9156ee4
...
...
@@ -42,8 +42,7 @@ public class SoundcloudParsingHelper {
Element
jsElement
=
doc
.
select
(
"script[src^=https://a-v2.sndcdn.com/assets/app]"
).
first
();
String
js
=
dl
.
download
(
jsElement
.
attr
(
"src"
));
clientId
=
Parser
.
matchGroup1
(
",client_id:\"(.*?)\""
,
js
);
return
clientId
;
return
clientId
=
Parser
.
matchGroup1
(
",client_id:\"(.*?)\""
,
js
);
}
public
static
String
toDateString
(
String
time
)
throws
ParsingException
{
...
...
@@ -138,7 +137,10 @@ public class SoundcloudParsingHelper {
JsonArray
responseCollection
=
responseObject
.
getArray
(
"collection"
);
for
(
Object
o
:
responseCollection
)
{
if
(
o
instanceof
JsonObject
)
collector
.
commit
(
new
SoundcloudStreamInfoItemExtractor
((
JsonObject
)
o
));
if
(
o
instanceof
JsonObject
)
{
JsonObject
object
=
(
JsonObject
)
o
;
collector
.
commit
(
new
SoundcloudStreamInfoItemExtractor
(
charts
?
object
.
getObject
(
"track"
)
:
object
));
}
}
String
nextStreamsUrl
;
...
...
src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamInfoItemExtractor.java
View file @
e9156ee4
...
...
@@ -7,7 +7,7 @@ import org.schabi.newpipe.extractor.stream.StreamType;
public
class
SoundcloudStreamInfoItemExtractor
implements
StreamInfoItemExtractor
{
pr
ivate
final
JsonObject
searchResult
;
pr
otected
final
JsonObject
searchResult
;
public
SoundcloudStreamInfoItemExtractor
(
JsonObject
searchResult
)
{
this
.
searchResult
=
searchResult
;
...
...
@@ -30,13 +30,12 @@ public class SoundcloudStreamInfoItemExtractor implements StreamInfoItemExtracto
@Override
public
String
getUploaderName
()
{
//return searchResult.getObject("user").getString("username");
return
searchResult
.
getObject
(
"track"
).
getObject
(
"user"
).
getString
(
"username"
);
return
searchResult
.
getObject
(
"user"
).
getString
(
"username"
);
}
@Override
public
String
getUploadDate
()
throws
ParsingException
{
return
SoundcloudParsingHelper
.
toDateString
(
searchResult
.
getObject
(
"track"
).
getString
(
"created_at"
));
return
SoundcloudParsingHelper
.
toDateString
(
searchResult
.
getString
(
"created_at"
));
}
@Override
...
...
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