JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #21  
Old 25.01.2021, 15:54
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 59,285
Default

Hi,

at this moment the User-Agent can only be changed for specific plugins if they have an option for this functionality.
If you want to change it globally, you can grab our source code and change it in there.

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager
JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #22  
Old 27.01.2021, 03:06
inzzzomnia inzzzomnia is offline
JD Fan
 
Join Date: Apr 2017
Posts: 72
Default

I know that it only can be changed if there's an option for it that's why I asked if it would be a big thing to make it possible on a wider scale since you already do it partially.
Fixing it by my self is kind of out of my league since I'm no programmer.

So what are the user agent that JD uses? Guess I'll have to figure out how to do it the other way around.
Reply With Quote
  #23  
Old 27.01.2021, 15:07
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 59,285
Default

Quote:
Originally Posted by inzzzomnia View Post
I know that it only can be changed if there's an option for it that's why I asked if it would be a big thing to make it possible on a wider scale since you already do it partially.
No idea.

Quote:
Originally Posted by inzzzomnia View Post
Fixing it by my self is kind of out of my league since I'm no programmer.
It's not a pending bugfix - what you've requested would be a new feature.

Quote:
Originally Posted by inzzzomnia View Post
So what are the user agent that JD uses?
Depends on various factors.
See JDBrowser/src/jd/http/Request.java
Starting from line 436 "getSuggestedUserAgent()".

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager
JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #24  
Old 01.08.2021, 03:17
artenox artenox is offline
I will play nice!
 
Join Date: Jul 2021
Posts: 1
Default

There are three ways to change User Agent.

1. Modify source code and compile your JDownloader build using Eclipse
The default User Agent is set in JDBrowser/src/jd/http/Request.java source code file
getSuggestedUserAgent() method
Instructions to compile https://jdownloader.org/knowledge/wi...nt/get-started
But it's pretty complicated (it didn't work for me) and you won't be able to get updates.
Instructions also don't tell you how to create a package (so you don't have to use Eclipse every time), it uses "ant" for that.
The size of source code is 1.4 GiB.
However you don't have to use your own build. You can try to take from it only one file JDHttp.jar which you need.

2. Modify binary code (patch/hack)
The default User Agent is located in file JDownloader/libs/JDHttp.jar and then after unpacking /jd/http/Request.class
JDHttp.jar is a zip archive. You can extract and add files to it using any archive manager (7Zip, WinRAR, Engrampa, etc).
Request.class is a binary file and should be edited in a binary editor (for example, Flexhex). Don't use a text editor, you can break.
Extract file Request.class, edit it and drag it back into archive.
But the length of User Agent cannot exceed the existing length. You won't be able to put a long User Agent (e.g. Chromium) without damaging it. In this case you will have to use method 1.
If the length of new User Agent is shorter, add spaces to it. Normal whitespaces (in binary representation 20 20), not null characters (00 00). Null characters are not allowed in that section.
You have to disable JDownloader updates (in advanced settings search for the word Update), otherwise file will be overwritten.
After each update, patching will have to be repeated. Although, you can create a script to automate it.

3. Use a local HTTPS proxy (aka MITM proxy)
The squid mentioned before is no longer relevant, since it doesn't support decrypting HTTPS traffic (which is predominant type on the Internet nowadays).
You can use HandyCache (there is an extension which lets you change User Agent, google it), Proximitron or Fiddler.
I personally tested HandyCache, it works. But the HTTPS decrypting feature is paid (free only first 30 minutes after each launch). And it is quite difficult to buy this program, especially for non-Russian users, although it is possible.
The disadvantage of this way: you have to use an additional program (and maybe more than one).
Advantage: you can continue to receive JDownloader updates, disable and change User Agent in realtime.
Proximitron is an old application and needs an addon to support HTTPS.
Local HTTPS proxies will most likely require a self-signed certificate to be installed on the system (this is not difficult). Although, I'm not sure, maybe JDownloader will work without it.
For Linux there is a console mitmproxy (python based, works by intercepting traffic with iptables). It supports changing User Agent but it's quite hard to configure, I guess. HandyCache is easier and works in Wine, but unfortunately free mode is limited.
Also note that not all of these proxies support upstream SOCKS proxy (in case you need it, of course).
SOCKS is supported in HandyCache. Not supported in: Proximitron, Fiddler, mitmproxy.
These proxy servers ignore HTTPS errors (e.g. outdated server certificate).

I personally use method 2.

Update: There is a class editor application for safe editing class files (requires Java installed on the system) **External links are only visible to Support Staff****External links are only visible to Support Staff**

Update 2 (mods, you can merge messages): Don't use class editor, it breaks file. Use a binary editor instead (Flexhex). But be careful. Don't modify characters that don't belong to User Agent. Make a backup.

Last edited by raztoki; 01.08.2021 at 15:45. Reason: user can't edit posts just yet, merging on behalf.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 19:08.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.