-
Notifications
You must be signed in to change notification settings - Fork 85
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
java.net.MalformedURLException: no protocol #30
Comments
Seems to happen on a witheld account where profile_image_url is empty {"protected":false,"name":"","created_at":"2011-01-14T09:27:09.000Z","username":"sputnik_fr","entities":{"description":{"urls":[{"start":340,"end":350,"url":"https://support.twitter.com/articles/20169222","expanded_url":"https://support.twitter.com/articles/20169222","display_url":"Learn more"}]}},"public_metrics":{"followers_count":95621,"following_count":219,"tweet_count":236481,"listed_count":1358},"profile_image_url":"","pinned_tweet_id":"1498740347144482820","description":"@sputnik_fr's account has been withheld in Portugal, Finland, Sweden, Ireland, Slovenia, Czech Republic, Poland, Slovakia, Hungary, Italy, Malta, Germany, Greece, Romania, Netherlands, Bulgaria, Austria, Luxembourg, Latvia, United Kingdom, Denmark, Lithuania, Croatia, Estonia, Cyprus, France, Spain, Belgium in response to a legal demand. Learn more.","url":"","id":"238080747","verified":true,"withheld":{"country_codes":["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],"scope":"user"}} |
@nrv, thank you for opening this issue, the fix will be done at the API level and not inside the SDK. |
I am encountering the same issue for the streaming endpoint.
|
@nrv, the API has been updated to handle empty urls. |
not fixed in latest version v2.0.3
|
It does not work even when the URL is contained into the field but the protocol is missing.
I even do not know which parameter I should remove, since I've already deleted |
In the meantime, you could still patch the sdk, see :
5533da8
Nicolas
Le 09/12/2022 à 15:03, Alessio Palmero Aprosio a écrit :
…
It does not work even when the URL is contained into the field but the
protocol is missing.
|com.google.gson.JsonIOException: java.net.MalformedURLException: no
protocol: Loulasassy.com at
com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:287) at
com.twitter.clientlib.model.UrlEntity$CustomTypeAdapterFactory$1.read(UrlEntity.java:543)
at
com.twitter.clientlib.model.UrlEntity$CustomTypeAdapterFactory$1.read(UrlEntity.java:532)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199) at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
at
com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
... |
I even do not know which parameter should I remove, since I've already
deleted |profile_image_url|. Any idea? Is it possible to fix this in
the next version? Or, as an alternative, is it possible to consider
the URLs as strings, so that this problem won't happen anymore?
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACWHXKCNMXKK2HKZIHE4Z3WMM34RANCNFSM522RCKVA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The problem is that this does not happen only with |
I see java.net.MalformedURLException: no protocol: occasionally when using the findUsersById or findUsersByUsername and including the profile_image_url field. I see this issue has been open for a while. In User, can profileImageUrl be a String rather than a URL? Or can exceptions could be handled so the entire call doesn't fail? |
When retrieving tweets with the full archive endpoint, asking for all expansions, I have the following error. It does not appear immediately, I'm able to retrieve a bunch of tweets before it is thrown, so it must be linked to a specific tweet/user data. I'm using the 2.0.1 sdk.
com.google.gson.JsonIOException: java.net.MalformedURLException: no protocol:
at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:287)
at com.twitter.clientlib.model.User$CustomTypeAdapterFactory$1.read(User.java:623)
at com.twitter.clientlib.model.User$CustomTypeAdapterFactory$1.read(User.java:612)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:130)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221)
at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:285)
at com.twitter.clientlib.model.Expansions$CustomTypeAdapterFactory$1.read(Expansions.java:459)
at com.twitter.clientlib.model.Expansions$CustomTypeAdapterFactory$1.read(Expansions.java:448)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:130)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221)
at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:285)
at com.twitter.clientlib.model.Get2TweetsSearchAllResponse$CustomTypeAdapterFactory$1.read(Get2TweetsSearchAllResponse.java:325)
at com.twitter.clientlib.model.Get2TweetsSearchAllResponse$CustomTypeAdapterFactory$1.read(Get2TweetsSearchAllResponse.java:314)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
at com.google.gson.Gson.fromJson(Gson.java:991)
at com.google.gson.Gson.fromJson(Gson.java:956)
at com.google.gson.Gson.fromJson(Gson.java:905)
at com.twitter.clientlib.JSON.deserialize(JSON.java:944)
at com.twitter.clientlib.ApiClient.deserialize(ApiClient.java:959)
at com.twitter.clientlib.ApiClient.handleResponse(ApiClient.java:1190)
at com.twitter.clientlib.ApiClient.execute(ApiClient.java:1091)
at com.twitter.clientlib.api.TweetsApi.tweetsFullarchiveSearchWithHttpInfo(TweetsApi.java:3853)
at com.twitter.clientlib.api.TweetsApi.access$6100(TweetsApi.java:87)
at com.twitter.clientlib.api.TweetsApi$APItweetsFullarchiveSearchRequest.execute(TweetsApi.java:4057)
The text was updated successfully, but these errors were encountered: