Comments (12)
Thank you Mr. Igor and sorry for taking too much of your time. I've learned a lot from this conversation alone. Keep up the good work and stay safe.
from java-youtube-downloader.
before calling response.data()
you should check if request was successful -response.ok()
if it returns false
you can check what is returned by response.error()
you don't need API KEY, this library works as web scraper
from java-youtube-downloader.
response.ok()
returns false
and response.error()
gives
"java.util.concurrent.ExecutionException: com.alibaba.fastjson2.JSONException: class java.lang.String cannot be converted to class java.lang.String"
from java-youtube-downloader.
class java.lang.String cannot be converted to class java.lang.String
seems very strange, may be you have some issues with java versions?
from java-youtube-downloader.
Which versions should i use? At the same time,
YoutubeVideoExtractor_Tests.java
returns "getVideo should be successful for default videos without signature"
YoutubeDownloader_Tests
returns: "download subtitles should work" as well as "download video should work"
Maybe its me that do not understand how this work
from java-youtube-downloader.
Java 8+ should works, but I mean maybe you have messed up classpath?
Also provide full stacktrace
response.error().printStackTrace()
from java-youtube-downloader.
`java.util.concurrent.ExecutionException: com.alibaba.fastjson2.JSONException:
class java.lang.String cannot be converted to class java.lang.String
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at com.github.kiulian.downloader.downloader.response.ResponseImpl.error(ResponseImpl.java:96)
at MainClass.videoInfo(MainClass.java:70)
at MainClass.main(MainClass.java:46)
Caused by: com.alibaba.fastjson2.JSONException: class java.lang.String cannot be converted to class java.lang.String
at com.alibaba.fastjson.JSONArray.toJavaList(JSONArray.java:817)
at com.github.kiulian.downloader.model.videos.VideoDetails.<init>(VideoDetails.java:30)
at com.github.kiulian.downloader.parser.ParserImpl.parseVideoDetails(ParserImpl.java:182)
at com.github.kiulian.downloader.parser.ParserImpl.parseVideoAndroid(ParserImpl.java:104)
at com.github.kiulian.downloader.parser.ParserImpl.parseVideo(ParserImpl.java:63)
at com.github.kiulian.downloader.parser.ParserImpl.lambda$0(ParserImpl.java:49)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
`
from java-youtube-downloader.
check which version of com.alibaba.fastjson
do you have in classpath
from java-youtube-downloader.
Yeah, like you pointed before, i had a problem with my classpath
and the overall project configuration.
I reset everything and started from scratch, now it works fine.
Thank you for the amazing work.
Just one quick question before i close: if i have the googlevideo.com/videoplayback
link from an API call and i just want to use this library for the download part, how do i proceed?
from java-youtube-downloader.
Not familiar with youtube API, what exactly link do you have? If it is direct link to video file you can simply copy code snippet responsible for downloading file.
Or you can manually create Format
, fill it with your data, create RequestVideoFileDownload
and call Downloader#downloadVideoAsFile
from java-youtube-downloader.
Yeah and that's the question actually, i have not found a way to manually create a Format
object with my desired data(url)
protected Format(JSONObject json, boolean isAdaptive, String clientVersion)
is the only option i see but can't use.
which is basically what i got from it.url()
in the code
But assume i got this link from another source, how do i create a Format
object with it?
from java-youtube-downloader.
yes, indeed there is no constructor for such case
but you can create JSONObject json
and populate it with required fields
from java-youtube-downloader.
Related Issues (20)
- How to Know The Size Of Video ? HOT 2
- Format.contentLength() returns null HOT 6
- Download completed immediately without having the full video HOT 5
- i have implement with your doc, using async..why cant get more info about video? HOT 2
- It seems like maven artifacts are gone causing dependency issues. HOT 2
- NumberFormatException HOT 3
- streamingData not found HOT 11
- Downloading files is too slow and sometimes fails. HOT 7
- some time can not get video info
- The downloader returns a null response. HOT 4
- No subtitles anymore HOT 3
- Missing formats HOT 5
- Not working anymore HOT 1
- Can not download video at any ratio.
- Playlist detail problem HOT 3
- not working anymore HOT 2
- Option to name video files when downloading HOT 1
- tiktok support
- Some weird console outputs while requesting video info HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-youtube-downloader.