Does not work in release mode, but works in debug mode #3

Closed
opened 2020-05-09 13:36:49 +00:00 by Foxite · 1 comment
Foxite commented 2020-05-09 13:36:49 +00:00 (Migrated from github.com)

This really baffles me.

This is what happens when you install a build in Release mode and try to download a video:

Time	Device Name	Type	PID	Tag	Message
05-09 15:31:30.483	LENOVO P2a42	Error	1327	FOXITE_YOUTUBE_DL	android.runtime.JavaProxyThrowable: System.Net.Http.HttpRequestException: Access denied ---> System.Net.Sockets.SocketException: Access denied
  at System.Net.Sockets.Socket..ctor (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x00069] in <96da85c30cfe4b818a5b42e4a4960274>:0 
  at System.Net.Sockets.DualSocketMultipleConnectAsync..ctor (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x0000d] in <96da85c30cfe4b818a5b42e4a4960274>:0 
  at System.Net.Sockets.Socket.ConnectAsync (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.SocketAsyncEventArgs e) [0x00056] in <96da85c30cfe4b818a5b42e4a4960274>:0 
  at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x00058] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
   --- End of inner exception stack trace ---
  at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x001ac] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at System.Net.Http.HttpConnectionPool.CreateConnectionAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00134] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync (System.Threading.Tasks.ValueTask`1[TResult] creationTask) [0x000a2] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at System.Net.Http.HttpConnectionPool.SendWithRetryAsync (System.Net.Http.HttpRequestMessage request, System.Boolean doRequestAuth, System.Threading.CancellationToken cancellationToken) [0x00089] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at System.Net.Http.RedirectHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ba] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at System.Net.Http.DecompressionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ca] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered (System.Threading.Tasks.Task`1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x000b3] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 
  at YoutubeExplode.ReverseEngineering.YoutubeHttpClient.SendAsync (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completion) [0x00073] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.ReverseEngineering.YoutubeHttpClient.GetAsync (System.String requestUri) [0x00073] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.ReverseEngineering.YoutubeHttpClient.GetStringAsync (System.String requestUri, System.Boolean ensureSuccess) [0x00072] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.ReverseEngineering.Responses.VideoInfoResponse+<>c__DisplayClass10_0.<GetAsync>b__0 () [0x000c4] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.Internal.Retry.WrapAsync[T] (System.Func`1[TResult] executeAsync) [0x0007a] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.Internal.Retry.WrapAsync[T] (System.Func`1[TResult] executeAsync) [0x000c4] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.ReverseEngineering.Responses.VideoInfoResponse.GetAsync (YoutubeExplode.ReverseEngineering.YoutubeHttpClient httpClient, System.String videoId, System.String sts) [0x0008e] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeExplode.Videos.VideoClient.GetAsync (YoutubeExplode.Videos.VideoId id) [0x00080] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 
  at YoutubeDL.MainActivity.DownloadVideo (System.String youtubeUrl) [0x000ed] in <f80de8aea4354d878c6a2cd80ad3acf2>:0 

If you download the same video in a Debug build, it works fine.

Perhaps this is an issue with Android where it is more lenient with security with Debug-mode apps.

This really baffles me. This is what happens when you install a build in Release mode and try to download a video: ``` Time Device Name Type PID Tag Message 05-09 15:31:30.483 LENOVO P2a42 Error 1327 FOXITE_YOUTUBE_DL android.runtime.JavaProxyThrowable: System.Net.Http.HttpRequestException: Access denied ---> System.Net.Sockets.SocketException: Access denied at System.Net.Sockets.Socket..ctor (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x00069] in <96da85c30cfe4b818a5b42e4a4960274>:0 at System.Net.Sockets.DualSocketMultipleConnectAsync..ctor (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x0000d] in <96da85c30cfe4b818a5b42e4a4960274>:0 at System.Net.Sockets.Socket.ConnectAsync (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.SocketAsyncEventArgs e) [0x00056] in <96da85c30cfe4b818a5b42e4a4960274>:0 at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x00058] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x001ac] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00134] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync (System.Threading.Tasks.ValueTask`1[TResult] creationTask) [0x000a2] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync (System.Net.Http.HttpRequestMessage request, System.Boolean doRequestAuth, System.Threading.CancellationToken cancellationToken) [0x00089] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at System.Net.Http.RedirectHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ba] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at System.Net.Http.DecompressionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ca] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered (System.Threading.Tasks.Task`1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x000b3] in <17c6e13ffc7949a6a36a35456d0a5e6f>:0 at YoutubeExplode.ReverseEngineering.YoutubeHttpClient.SendAsync (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completion) [0x00073] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.ReverseEngineering.YoutubeHttpClient.GetAsync (System.String requestUri) [0x00073] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.ReverseEngineering.YoutubeHttpClient.GetStringAsync (System.String requestUri, System.Boolean ensureSuccess) [0x00072] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.ReverseEngineering.Responses.VideoInfoResponse+<>c__DisplayClass10_0.<GetAsync>b__0 () [0x000c4] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.Internal.Retry.WrapAsync[T] (System.Func`1[TResult] executeAsync) [0x0007a] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.Internal.Retry.WrapAsync[T] (System.Func`1[TResult] executeAsync) [0x000c4] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.ReverseEngineering.Responses.VideoInfoResponse.GetAsync (YoutubeExplode.ReverseEngineering.YoutubeHttpClient httpClient, System.String videoId, System.String sts) [0x0008e] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeExplode.Videos.VideoClient.GetAsync (YoutubeExplode.Videos.VideoId id) [0x00080] in <ef456a0a3cc04dabbf8f1987f09c50a9>:0 at YoutubeDL.MainActivity.DownloadVideo (System.String youtubeUrl) [0x000ed] in <f80de8aea4354d878c6a2cd80ad3acf2>:0 ``` If you download the same video in a Debug build, it works fine. Perhaps this is an issue with Android where it is more lenient with security with Debug-mode apps.
Foxite commented 2020-05-11 08:40:34 +00:00 (Migrated from github.com)

Fixed by adding internet permissions. 😅

Fixed by adding internet permissions. 😅
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Foxite/YoutubeDL#3
No description provided.