add feed function

This commit is contained in:
Christian Schabesberger 2016-08-01 02:10:38 +02:00
parent 6beb36f92f
commit f3a73ecc4a
2 changed files with 6 additions and 2 deletions

View File

@ -147,7 +147,7 @@ public class ChannelActivity extends AppCompatActivity {
@Override
public void onClick(View view) {
Log.d(TAG, info.feed_url);
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(info.feed_url + ".rss"));
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(info.feed_url));
startActivity(i);
}
});

View File

@ -122,7 +122,11 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
@Override
public String getFeedUrl() throws ParsingException {
return siteUrl + "/feed";
try {
return doc.select("link[title=\"RSS\"]").first().attr("abs:href");
} catch(Exception e) {
throw new ParsingException("Could not get feed url", e);
}
}
private String getUserUrl() throws ParsingException {