-
-
Notifications
You must be signed in to change notification settings - Fork 543
[SoundCloud] Fix SoundCloud HLS expiry #1325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
absurdlylongusername
wants to merge
16
commits into
TeamNewPipe:dev
Choose a base branch
from
absurdlylongusername:fix-soundcloud-hls-expiry
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
cabd55e
Fix retrieving the like count for YouTube videos with no likes
G-flat 00d9b7e
Merge pull request #70 from G-flat/fix_like_count_for_yt_videos_with_…
ShareASmile 7dd1a69
[YouTube] Fallback to playlist uploader on course playlists
FineFindus 936bac3
[YouTube] only apply course-playlists fallback for courses
FineFindus bf6823d
Return an empty title string for YouTube videos with no title
G-flat 44350db
Add test for YouTube video with no title
G-flat 7045c68
Add logging functionality to extractor and add some logging
absurdlylongusername d879c70
Fix null exception in tests
absurdlylongusername 953675b
Final edits
absurdlylongusername 348d8fb
[SoundCloud] Validate http response code in SoundcloudParsingHelper
absurdlylongusername 0d851d0
[SoundCloud] Add logging to SoundcloudParsingHelper, SoundcloudStream…
absurdlylongusername 61534c8
[SoundCloud] Refactor Soundcloud audio stream extraction code to sepa…
absurdlylongusername ec51b71
Logging syntax changes
absurdlylongusername 5b6c372
Fix checkstyle (curse you checkstyle)
absurdlylongusername 5d590c6
Fix Soundcloud HLS Opus Regex to include hyphen
absurdlylongusername 95408f3
Fix javadoc so jitpack can build?
absurdlylongusername File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
extractor/src/main/java/org/schabi/newpipe/extractor/StreamingServiceId.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package org.schabi.newpipe.extractor; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public enum StreamingServiceId { | ||
| NO_SERVICE_ID, | ||
| YOUTUBE, | ||
| SOUNDCLOUD, | ||
| MEDIACCC, | ||
| PEERTUBE, | ||
| BANDCAMP; | ||
|
|
||
|
|
||
| private static final StreamingServiceId[] VALUES = values(); | ||
|
|
||
| public static String nameFromId(final int serviceId) { | ||
| try { | ||
| return VALUES[Objects.checkIndex(serviceId + 1, VALUES.length)].name(); | ||
| } catch (final IndexOutOfBoundsException e) { | ||
| throw new IllegalArgumentException("Invalid serviceId: " + serviceId, e); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/HttpResponseException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package org.schabi.newpipe.extractor.exceptions; | ||
|
|
||
| import java.io.IOException; | ||
| import org.schabi.newpipe.extractor.downloader.Response; | ||
|
|
||
| public class HttpResponseException extends IOException { | ||
| public HttpResponseException(final Response response) { | ||
| this("Error in HTTP Response for " + response.latestUrl() + "\n\t" | ||
| + response.responseCode() + " - " + response.responseMessage()); | ||
| } | ||
|
|
||
| public HttpResponseException(final String message) { | ||
| super(message); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file used anywhere? Also, the reason why services are not implemented as an enum is also because it should be possible to dynamically add service implementations (think e.g. of plugins). Obviously this has never happened yet, but iirc that's why the API is like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in the NewPipe PR for logging the names of services.
It's possible to have enums and still allow for dynamic implementations. Since plugins are a long way away, I think it makes a lot more sense to have enums for each service to improve readability, traceability, logging and type safety.
Howbeit, I'm not going to change the entire API to use enums because that's long: I just want the nice id -> name static method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use this utility method instead? https://github.com/TeamNewPipe/NewPipe/blob/2a9c6f05387866bef2c42ab67226c14936917d27/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java#L138
But yeah I agree this is not the best. We should not have the concept of service ID at all except for saving stuff to database, so every
StreamInfoshould not have anygetServiceId()method but rathergetService()directly. So we don't have to keep switching back and forth betweenintandService