mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-29 16:30:29 +05:30
Fix errors being logged due to invalid requests. (#303)
This commit is contained in:
parent
606cbf5ca6
commit
c812ace4f6
@ -274,6 +274,9 @@ public class ResponseHelper {
|
|||||||
public static byte[] channelPageResponse(String channelId, String prevpageStr)
|
public static byte[] channelPageResponse(String channelId, String prevpageStr)
|
||||||
throws IOException, ExtractionException {
|
throws IOException, ExtractionException {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(prevpageStr))
|
||||||
|
return mapper.writeValueAsBytes(new InvalidRequestResponse());
|
||||||
|
|
||||||
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
||||||
|
|
||||||
InfoItemsPage<StreamInfoItem> info = ChannelInfo.getMoreItems(YOUTUBE_SERVICE,
|
InfoItemsPage<StreamInfoItem> info = ChannelInfo.getMoreItems(YOUTUBE_SERVICE,
|
||||||
@ -388,6 +391,9 @@ public class ResponseHelper {
|
|||||||
public static byte[] playlistPageResponse(String playlistId, String prevpageStr)
|
public static byte[] playlistPageResponse(String playlistId, String prevpageStr)
|
||||||
throws IOException, ExtractionException {
|
throws IOException, ExtractionException {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(prevpageStr))
|
||||||
|
return mapper.writeValueAsBytes(new InvalidRequestResponse());
|
||||||
|
|
||||||
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
||||||
|
|
||||||
InfoItemsPage<StreamInfoItem> info = PlaylistInfo.getMoreItems(YOUTUBE_SERVICE,
|
InfoItemsPage<StreamInfoItem> info = PlaylistInfo.getMoreItems(YOUTUBE_SERVICE,
|
||||||
@ -552,6 +558,9 @@ public class ResponseHelper {
|
|||||||
public static byte[] searchPageResponse(String q, String filter, String prevpageStr)
|
public static byte[] searchPageResponse(String q, String filter, String prevpageStr)
|
||||||
throws IOException, ExtractionException {
|
throws IOException, ExtractionException {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(prevpageStr))
|
||||||
|
return mapper.writeValueAsBytes(new InvalidRequestResponse());
|
||||||
|
|
||||||
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
||||||
|
|
||||||
InfoItemsPage<InfoItem> pages = SearchInfo.getMoreItems(YOUTUBE_SERVICE,
|
InfoItemsPage<InfoItem> pages = SearchInfo.getMoreItems(YOUTUBE_SERVICE,
|
||||||
@ -622,6 +631,9 @@ public class ResponseHelper {
|
|||||||
|
|
||||||
public static byte[] commentsPageResponse(String videoId, String prevpageStr) throws Exception {
|
public static byte[] commentsPageResponse(String videoId, String prevpageStr) throws Exception {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(prevpageStr))
|
||||||
|
return mapper.writeValueAsBytes(new InvalidRequestResponse());
|
||||||
|
|
||||||
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
Page prevpage = mapper.readValue(prevpageStr, Page.class);
|
||||||
|
|
||||||
InfoItemsPage<CommentsInfoItem> info = CommentsInfo.getMoreItems(YOUTUBE_SERVICE, "https://www.youtube.com/watch?v=" + videoId, prevpage);
|
InfoItemsPage<CommentsInfoItem> info = CommentsInfo.getMoreItems(YOUTUBE_SERVICE, "https://www.youtube.com/watch?v=" + videoId, prevpage);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user