Skip to content
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

Regex error when parsing the Youtube JavaScript code #785

Merged
merged 3 commits into from
Feb 1, 2022

Conversation

AbduAmeen
Copy link
Contributor

@AbduAmeen AbduAmeen commented Feb 1, 2022

Changed the regex to account for nonword characters

Fixes: TeamNewPipe/NewPipe#7734

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

@AbduAmeen
Copy link
Contributor Author

I was not able to test it due to problems getting it to run with my local build of NewPipe. However, others have said it works.

TeamNewPipe/NewPipe#7734 (comment)

@XiangRongLin
Copy link
Collaborator

@AbduAmeen The tests are failing, can you look into that?
https://github.com/TeamNewPipe/NewPipeExtractor/runs/5017585201?check_suite_focus=true#step:5:59


I was not able to test it due to problems getting it to run with my local build of NewPipe. However, others have said it works.

Did the guide from the readme not work? https://github.com/TeamNewPipe/NewPipeExtractor#testing-changes
Otherwise use JitPack: https://jitpack.io/#AbduAmeen/NewPipeExtractor/regex_error-SNAPSHOT

@AudricV AudricV added ASAP bug youtube service, https://www.youtube.com/ labels Feb 1, 2022
@AbduAmeen
Copy link
Contributor Author

I was able to get the local build to work. The initial fix also needed to remove the braces. The fix provided here worked.

@Ty3r0X

This comment has been minimized.

@opusforlife2
Copy link
Collaborator

@AbduAmeen Thanks so much for the fix! Could you please upload the APK so that we can link it in the pinned issue?

@AbduAmeen
Copy link
Contributor Author

@opusforlife2 fixed.zip

@infinitewaveparticle
Copy link

@opusforlife2 fixed.zip

This apk file will not install on my phone at all... Android 8

@opusforlife2
Copy link
Collaborator

@AbduAmeen Could you please check that before we link it?

@Ty3r0X
Copy link

Ty3r0X commented Feb 1, 2022

@infinitewaveparticle it's a debug apk file, normal installation won't work. Try using adb install -t apkfile.apk

@opusforlife2
Copy link
Collaborator

@TechGuyOnTGB All our PR APK are debug ones and they install normally. I can confirm this one isn't installing.

@AbduAmeen
Copy link
Contributor Author

Sorry about that. I didn't realize android forces you to sign your apks.
app-release.zip

@opusforlife2
Copy link
Collaborator

It's quite stupid that Android doesn't just tell you "this APK is unsigned so it can't be installed."

@Ty3r0X
Copy link

Ty3r0X commented Feb 1, 2022

@AbduAmeen yes the APK works as expected, tested inside Anbox. Hope it gets merged with the upstream code. Thank you for the effort you've put in! ^_^

Comment on lines 70 to 72
int arrayStartBrace = functionName.indexOf("[");

if (arrayStartBrace > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both paths of the if case covered by tests? Because I don't quite understand why this is needed and cannot be adjusted in the regex

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition is always true for the tests we have currently

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested a few more video ids and the condition was still true. However, I do not see a reason to remove the condition. I'd keep it as it is.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branching doesn't depend on video, but on the player version. To test the other case, you have to force an older player like https://www.youtube.com/s/player/8040e515/player_ias.vflset/en_US/base.js

@AudricV
Copy link
Member

AudricV commented Feb 1, 2022

Also, please use final where possible.

@TobiGr TobiGr merged commit 65129e6 into TeamNewPipe:dev Feb 1, 2022
@Gardakant
Copy link

Any idea when the new apk will make it to F-Droid ?

@Ty3r0X
Copy link

Ty3r0X commented Feb 1, 2022

@Gardakant if you have newpipe's repo on f-droid, I think it should be released shortly. If you got newpipe from fdroid's default repo, expect to wait a bit, since it takes time to pull the source.

@AbduAmeen AbduAmeen deleted the regex_error branch February 2, 2022 16:02
@CESARKHALID
Copy link

please any one here help me

i cant make change on this scripte YoutubeThrottlingDecrypter.java

who can show me to find this java scripte and how i change it bcz i write to read only not possible to change on it

@jlhumbert
Copy link

When I try to install this version on Android 11, it looks like it's installing, then I receive a message that says, "App not installed".

@Nemris
Copy link

Nemris commented Feb 11, 2022

@jlhumbert Off-topic and cannot reproduce - but try installing with adb if you have a computer nearby, and look at the (way more informative) error message.

@jlhumbert
Copy link

jlhumbert commented Feb 12, 2022 via email

@TobiGr
Copy link
Member

TobiGr commented Feb 12, 2022

there is already a fixed version released. No need to install a debug version
https://github.com/TeamNewPipe/NewPipeExtractor/releases/tag/v0.21.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASAP bug youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Video Will play (any video)