{"record":{"id":"ed83d62917ba8679","repo":"DrKLO/Telegram","slug":"no-license-url","errorCode":null,"errorMessage":"No license URL","messagePattern":"No license URL","errorType":"exception","errorClass":"MediaDrmCallbackException","httpStatus":null,"severity":"critical","filePath":"TMessagesProj/src/main/java/com/google/android/exoplayer2/drm/HttpMediaDrmCallback.java","lineNumber":137,"sourceCode":"  public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request)\n      throws MediaDrmCallbackException {\n    String url =\n        request.getDefaultUrl() + \"&signedRequest=\" + Util.fromUtf8Bytes(request.getData());\n    return executePost(\n        dataSourceFactory,\n        url,\n        /* httpBody= */ null,\n        /* requestProperties= */ Collections.emptyMap());\n  }\n\n  @Override\n  public byte[] executeKeyRequest(UUID uuid, KeyRequest request) throws MediaDrmCallbackException {\n    String url = request.getLicenseServerUrl();\n    if (forceDefaultLicenseUrl || TextUtils.isEmpty(url)) {\n      url = defaultLicenseUrl;\n    }\n    if (TextUtils.isEmpty(url)) {\n      throw new MediaDrmCallbackException(\n          new DataSpec.Builder().setUri(Uri.EMPTY).build(),\n          Uri.EMPTY,\n          /* responseHeaders= */ ImmutableMap.of(),\n          /* bytesLoaded= */ 0,\n          /* cause= */ new IllegalStateException(\"No license URL\"));\n    }\n    Map<String, String> requestProperties = new HashMap<>();\n    // Add standard request properties for supported schemes.\n    String contentType =\n        C.PLAYREADY_UUID.equals(uuid)\n            ? \"text/xml\"\n            : (C.CLEARKEY_UUID.equals(uuid) ? \"application/json\" : \"application/octet-stream\");\n    requestProperties.put(\"Content-Type\", contentType);\n    if (C.PLAYREADY_UUID.equals(uuid)) {\n      requestProperties.put(\n          \"SOAPAction\", \"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense\");\n    }\n    // Add additional request properties.","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/src/main/java/com/google/android/exoplayer2/drm/HttpMediaDrmCallback.java#L119-L155","documentation":"HttpMediaDrmCallback.executeKeyRequest throws MediaDrmCallbackException (wrapping IllegalStateException('No license URL')) when, after consulting the request's license server URL and falling back to a default license URL, the result is still empty. The DRM callback cannot issue an HTTP key request without a destination, so it fails fast rather than making a request to Uri.EMPTY.","triggerScenarios":"KeyRequest.getLicenseServerUrl() returns empty AND forceDefaultLicenseUrl is false (or the default URL is also empty), so no usable license server remains.","commonSituations":"DASH/HLS/SmoothStreaming manifest or MediaDrm config missing a license URL; the server-side key request does not embed a license URL and the app did not set a default via the HttpMediaDrmCallback constructor; forceDefaultLicenseUrl left false while defaultLicenseUrl is empty.","solutions":["Provide a default license URL to the HttpMediaDrmCallback constructor so the fallback is non-empty.","Ensure the manifest/media embeds a valid license URL (or set it on the DRM InitData).","Set forceDefaultLicenseUrl=true only when a valid default license URL has been configured."],"exampleFix":"// before\ncallback = new HttpMediaDrmCallback(\"\"); // no default\n\n// after\nHttpMediaDrmCallback callback =\n    new HttpMediaDrmCallback(\"https://license.example.com/acquire\", httpDataSourceFactory);","handlingStrategy":"validation","validationCode":"// ensure a usable license URL exists before key request\nString url = forceDefault ? defaultLicenseUrl : request.getLicenseServerUrl();\nif (TextUtils.isEmpty(url)) url = defaultLicenseUrl;\nif (TextUtils.isEmpty(url)) throw new IllegalStateException(\"configure a license URL\");","typeGuard":null,"tryCatchPattern":"try { callback.executeKeyRequest(uuid, request); }\ncatch (MediaDrmCallbackException e) { /* surface to user; prompt for license config */ }","preventionTips":["Always pass a non-empty default license URL to HttpMediaDrmCallback.","Embed the license URL in the manifest/InitData when possible.","Never set forceDefaultLicenseUrl=true without a valid default URL."],"tags":["drm","exoplayer","license","configuration","media-drm","network"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}