Change json dependency

The previous was conflicting with the built-in version of android, this should solve it as it has a different package name (with the advantage of being able to receive updates).
This commit is contained in:
Mauricio Colli 2017-08-11 14:29:11 -03:00
parent 03634a2b6a
commit b719e59fae
13 changed files with 21 additions and 19 deletions

View file

@ -5,7 +5,7 @@ repositories {
}
dependencies {
implementation 'org.json:json:20160807'
implementation 'com.github.openjson:openjson:1.0.8'
implementation 'org.jsoup:jsoup:1.9.2'
implementation 'org.mozilla:rhino:1.7.7.1'

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONObject;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.StreamingService;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONObject;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor;
public class SoundcloudChannelInfoItemExtractor implements ChannelInfoItemExtractor {

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONArray;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONObject;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.StreamingService;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONArray;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONObject;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.MediaFormat;
import org.schabi.newpipe.extractor.NewPipe;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONObject;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
import org.schabi.newpipe.extractor.stream.StreamType;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.json.JSONArray;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONObject;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.SuggestionExtractor;

View file

@ -1,8 +1,8 @@
package org.schabi.newpipe.extractor.services.youtube;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View file

@ -1,7 +1,7 @@
package org.schabi.newpipe.extractor.services.youtube;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.youtube;
import org.json.JSONObject;
import com.github.openjson.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View file

@ -1,6 +1,6 @@
package org.schabi.newpipe.extractor.services.youtube;
import org.json.JSONArray;
import com.github.openjson.JSONArray;
import org.schabi.newpipe.extractor.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.SuggestionExtractor;
@ -54,7 +54,9 @@ public class YoutubeSuggestionExtractor extends SuggestionExtractor {
String response = dl.download(url);
try {
JSONArray suggestionsArray = new JSONArray(response).getJSONArray(1);
for (Object suggestion : suggestionsArray) suggestions.add(suggestion.toString());
for (int i = 0; i < suggestionsArray.length(); i++) {
suggestions.add(suggestionsArray.get(i).toString());
}
} catch (Exception e) {
throw new ParsingException("Could not parse suggestions response.", e);
}