Jump to content

Channel logo requests without user agent => 403 Forbidden error


Freddy436

Recommended Posts

Freddy436

Hello,

I noticed that emby requests the channel logos without specifing any user-agent in the request.

 

Example request for this logo:

https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/WDR_HD_Logo_2019.svg/320px-WDR_HD_Logo_2019.svg.png

GET /wikipedia/commons/thumb/4/4e/WDR_HD_Logo_2019.svg/320px-WDR_HD_Logo_2019.svg.png HTTP/1.1
Host: upload.wikimedia.org
Accept-Encoding: deflate
traceparent: 00-0e00ed5d3e24bf0983db30b869bd06f2-c5f623eee5212cd3-00

 

Many Wikipedia servers respond with an Error 403 (Forbidden)

ERROR 403: Forbidden. Please comply with the User-Agent policy: https://meta.wikimedia.org/wiki/User-Agent_policy

Please note that wikipedia uses a CDN with multiple servers, some of the server apparently don't check for the user agent, so it "randomly" works sometimes.

Emby Log:

09:30:08.944 Info HttpClient: GET https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/WDR_HD_Logo_2019.svg/320px-WDR_HD_Logo_2019.svg.png
09:30:09.014 Error Server: Error processing request
	*** Error Report ***
	Version: 4.7.14.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby-server -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 5.15.0-89-generic (buildd@bos03-amd64-016) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #99-Ubuntu
	Framework: .NET 6.0.20
	OS/Process: x64/x64
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby-server
	Application path: /opt/emby-server/system
	MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: Forbidden
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
	   at Emby.Providers.Manager.ProviderManager.SaveImageFromRemoteUrl(BaseItem item, LibraryOptions libraryOptions, String url, ImageType type, Nullable`1 imageIndex, Boolean isFallbackImage, CancellationToken cancellationToken)
	   at Emby.Api.Images.ImageService.Post(UpdateItemImageFromUrl request)
	   at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IServerApplicationHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: Emby.Server.Implementations
	TargetSite: Void MoveNext()

Can you please make emby send a user agent (preferrably some generic/spoofed Firefox/Chrome user agent) when requesting channel logos?

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...