prof79 / fansly-downloader-ng

Easy-to-use fansly.com content downloading tool. Written in Python and available as a standalone Windows Executable. Enjoy your Fansly content offline anytime, anywhere in the highest possible content resolution! Fully customizable to download in bulk or single: photos, videos & audio from timeline, messages, collection & single posts.
GNU General Public License v3.0
301 stars 18 forks source link

"missing groupId" error downloading messages #90

Open spaghetti-ii opened 2 months ago

spaghetti-ii commented 2 months ago

IMPORTANT: Be sure to replace all {{ template sections ⚠️}} or your issue may be discarded.

Bug Description

Program fails to download any media from messages and fails with "Response code: 400".

ErrorScreenshot

Expected behavior

Media from messages are downloaded without error.

Actual behavior

Error is thrown and messages are not process. Scrape can continue by hitting enter, but only downloads content from timeline.

Environment Information

User Research

( fill [ ] with x, if you've already done said task )

I have done the following:

Additional context

Issue seems to be a change with Fansly requiring groupId on messages. Happened recently that I noticed (within 1-2 weeks) since time of writing.

PsychoSid commented 2 months ago

fwiw I get this too (v0.9.7)

oksndr commented 2 months ago

Getting the same error, tried with "Timeline", "Post" and "Collection" and it worked, "Normal" and "Messages" it's when it fails.

PsychoSid commented 2 months ago

I don't get the error with collection but I have some collections and nothing is downloaded from them ? Do they have to be in a collection with a specific name ?

oksndr commented 2 months ago

I don't get the error with collection but I have some collections and nothing is downloaded from them ? Do they have to be in a collection with a specific name ?

"Collection" option is to download what you have purchased and can be seen at https://fansly.com/collection

Any collection you have created by selecting and organizing your videos is not part of the "Collection" option

bssoul commented 2 months ago

I get the same error with messages. with both 9.3 & 9.7 I had no luck with 9.9 when it came out & those two were working so I just used them

FabulousSoldier commented 2 months ago

I get the same error with messages on v0.9.9

lordoffools commented 2 months ago

Can confirm that I'm seeing the same issue with messages. Reproduces consistently across all creators.

 Info | 07:59 || Initiating Messages procedure. Standby for results.
 [31]ERROR | 07:59 || Failed Messages download. Response code: 400
{"success":false,"error":{"code":99,"details":"missing groupId"}}

This only happens with Messages content.

lordoffools commented 2 months ago

Gentle nudge to @prof79. Thank you very much!!

Gnuclear commented 2 months ago

I figured out how to fix this.

in /api/fansly.py, change the url in the get_group function: old url: https://apiv3.fansly.com/api/v1/group new url: https://apiv3.fansly.com/api/v1/messaging/groups

in /download/messages.py, change this line: groups_response = groups_response.json()['response']['groups'] to this: groups_response = groups_response.json()['response']['aggregationData']['groups']

ZincStoat commented 2 months ago

I figured out how to fix this.

You absolute star!

bssoul commented 2 months ago

I figured out how to fix this.

in /api/fansly.py, change the url in the get_group function: old url: https://apiv3.fansly.com/api/v1/group new url: https://apiv3.fansly.com/api/v1/messaging/groups

in /download/messages.py, change this line: groups_response = groups_response.json()['response']['groups'] to this: groups_response = groups_response.json()['response']['aggregationData']['groups']

Where do we change that?

jmennAcc commented 2 months ago

I figured out how to fix this.

in /api/fansly.py, change the url in the get_group function: old url: https://apiv3.fansly.com/api/v1/group new url: https://apiv3.fansly.com/api/v1/messaging/groups

in /download/messages.py, change this line: groups_response = groups_response.json()['response']['groups'] to this: groups_response = groups_response.json()['response']['aggregationData']['groups']

I can confirm that these changes work (v0.9.9). Thank you very very much!

bssoul commented 2 months ago

Can someone explain to me how to make those changes. In my folder for the 9.3 version this is all I have Capture

oksndr commented 2 months ago

When running the fansly_downloader_ng.py I get the following error, someone else? Or someone who could share the .exe for 9.7 or 9.9?

Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information.

= RESTART: D:\folder\Fansly_Downloader_NG-Windows-v0.9.7\fansly-downloader-ng-main\fansly_downloader_ng.py Traceback (most recent call last): File "D:\folder\Fansly_Downloader_NG-Windows-v0.9.7\fansly-downloader-ng-main\fansly_downloader_ng.py", line 37, in <module> from config import FanslyConfig, load_config, validate_adjust_config File "D:\folder\Fansly_Downloader_NG-Windows-v0.9.7\fansly-downloader-ng-main\config\__init__.py", line 4, in <module> from .config import copy_old_config_values, load_config File "D:\folder\Fansly_Downloader_NG-Windows-v0.9.7\fansly-downloader-ng-main\config\config.py", line 12, in <module> from config.fanslyconfig import FanslyConfig File "D:\folder\Fansly_Downloader_NG-Windows-v0.9.7\fansly-downloader-ng-main\config\fanslyconfig.py", line 9, in <module> from config.modes import DownloadMode File "D:\folder\Fansly_Downloader_NG-Windows-v0.9.7\fansly-downloader-ng-main\config\modes.py", line 3, in <module> from strenum import StrEnum ModuleNotFoundError: No module named 'strenum'

ZincStoat commented 2 months ago

When running the fansly_downloader_ng.py I get the following error, someone else? Or someone who could share the .exe for 9.7 or 9.9?

To install the required python support modules (for Windows) you need to run pip3 install -r requirements.txt from the folder where fansly-downloader-ng.py is located

The exe's are available from the Releases page, but they haven't been updated with the fix for this issue yet, so running the Python app is your best option for now.

oksndr commented 2 months ago

When running the fansly_downloader_ng.py I get the following error, someone else? Or someone who could share the .exe for 9.7 or 9.9?

To install the required python support modules (for Windows) you need to run pip3 install -r requirements.txt from the folder where fansly-downloader-ng.py is located

The exe's are available from the Releases page, but they haven't been updated with the fix for this issue yet, so running the Python app is your best option for now.

Already did it, followed the instructions at main page

Gnuclear commented 2 months ago

When running the fansly_downloader_ng.py I get the following error, someone else? Or someone who could share the .exe for 9.7 or 9.9?

line 3, in from strenum import StrEnum ModuleNotFoundError: No module named 'strenum'`

path\to\python.exe -m pip install strenum

oksndr commented 2 months ago

When running the fansly_downloader_ng.py I get the following error, someone else? Or someone who could share the .exe for 9.7 or 9.9? line 3, in from strenum import StrEnum ModuleNotFoundError: No module named 'strenum'`

path\to\python.exe -m pip install strenum

Thanks man, when running it I got the message that I already had installed, however it pointed the directory, being in "Python\Python39\Lib\site-packages" so figured the modules were in the wrong folder.

Manually copied them one by one as the downloader was requesting for them until it run, but wasn't finding any new messages. Made the mistake of copying the entire folder from "Python39" to "Python311" and it broke, decided to uninstall "Python39" and "Python38", run the "pip install -r requirements.txt" and this time it updated the "Python312" folder, which ultimately let me run the "fansly_downloader_ng.py" using "Messages" download mode.

lordoffools commented 2 months ago

Hmm, so can anyone confirm that the fix above actually pulls media in Messages? It made the error go away, but it also consistently results in this:

Info | 04:54 || Initiating Messages procedure. Standby for results.
WARNING | 04:54 || Could not find a chat history with xxxxxx; skipping messages download ...

This is despite the fact there's several media (video and photos) available in Messages with that particular creator for download (unlocked, free, available).

PsychoSid commented 2 months ago

It is working for me with messages on v0.9.9

lordoffools commented 2 months ago

It is working for me with messages on v0.9.9

Hmm, very strange. I'm running v0.9.9 with the fix noted above, as well.

Consistently able to reproduce it not working (with the same warning/error from above) across multiple creators.

I'll keep playing with it.

lordoffools commented 2 months ago

Interesting! I was able to trigger a scrape and download of media in Messages only after I generated some chat history with the creator myself first, despite there being history coming from them, otherwise the script concluded there was no chat history (per the warning/error message above).

Very strange. It wasn't always behaving this way -- only after it broke, and following the fix from above.

Gnuclear commented 2 months ago

Maybe try this url for the API: https://apiv3.fansly.com/api/v1/messaging/groups?limit=1000&ngsw-bypass=true

I realized that the api by default only returns 20 results, so the group might not have been found because the messages you wanted were older. And by writing a new message, it bumped it up (and replaced one of the 20 results it was returning).

So, the solution should just be to ask for more results. Either in one go by adding ?limit=1000&ngsw-bypass=true

Or if that were to stop working, it might have to make multiple requests, with ?offset=0&ngsw-bypass=true, and increase offset by 20 each request

lordoffools commented 2 months ago

Hmm, with the fix noted above, it's no longer scraping, counting, and downloading messages.

Anyone else experiencing this issue - again?

@prof79

lordoffools commented 2 months ago

Switching from https://apiv3.fansly.com/api/v1/messaging/groups to https://apiv3.fansly.com/api/v1/messaging/groups?limit=1000&ngsw-bypass=true has worked.

Thanks, @Gnuclear!

cenax commented 2 months ago

How do i fix this while using the .exe?

pzych0p4th commented 1 month ago

I am terrible sorry, but does anyone have the patience to try and explain this like its a 5 year old, I am really not getting everything here, I am usually fairly decent around what I am doing, but this is a little too deep for me. Ive tried running the pip3 install -r requirements.txt command but it gives me an error with building wheel. Building wheel for plyvel-ci (pyproject.toml) error: subprocess-exited-with-error and a whole lot after that too. I have Python 3.12.6 installed, also Visual C++ 14 or above, so I am not sure what Im doing wrong, and honestly I dont even know what the pip3 install -r requirements.txt does, lmao. Does it allow me to run the fansly_downloader_ng.py as if it were the exe or am I completely off?

PsychoSid commented 1 month ago

I don't know about Windows so I cannot help too much with the OS there. But one thing is common and that is how terrible Python packaging is. I had to install packages then the install the pip/wheels via the requirements.txt which is a list of modules used by the scripts here

pip install --upgrade pip setuptools wheel
sudo apt-get install python-dev python3-dev libleveldb-dev  python3.12-tk

This is running under a 3.12.x venv and then it got everything working.

pzych0p4th commented 1 month ago

I think I got all the packages installed manually with the pip install command, also did the pip install --upgrade pip setuptools wheel, but I dont understand the sudo apt-get install python-dev python3-dev libleveldb-dev python3.12-tk, it isnt recognized. Oh well, I think Ill just wait for an actual update where this might get fixed. 🙏🏻👌🏻

PsychoSid commented 1 month ago

Those apt-get commands are for Ubuntu/Debian linux only. You will need the equivalents for your OS

bssoul commented 1 month ago

I think I got all the packages installed manually with the pip install command, also did the pip install --upgrade pip setuptools wheel, but I dont understand the sudo apt-get install python-dev python3-dev libleveldb-dev python3.12-tk, it isnt recognized. Oh well, I think Ill just wait for an actual update where this might get fixed. 🙏🏻👌🏻

I don't have any inside information but I do not believe their will be another update. I think prof79 is done with it. I hope their is but I don't believe their will be.

WX93623 commented 1 month ago

just me or some videos dont even fully download anymore despite having a subscription to the creator ? :/

juntrone commented 1 month ago

I am terrible sorry, but does anyone have the patience to try and explain this like its a 5 year old, I am really not getting everything here, I am usually fairly decent around what I am doing, but this is a little too deep for me. Ive tried running the pip3 install -r requirements.txt command but it gives me an error with building wheel. Building wheel for plyvel-ci (pyproject.toml) error: subprocess-exited-with-error and a whole lot after that too. I have Python 3.12.6 installed, also Visual C++ 14 or above, so I am not sure what Im doing wrong, and honestly I dont even know what the pip3 install -r requirements.txt does, lmao. Does it allow me to run the fansly_downloader_ng.py as if it were the exe or am I completely off?

@pzych0p4th I was having the same issue with not being able to build the wheel or whatever and had almost given up. Commenting out the lines mentioned in this thread: https://github.com/prof79/fansly-downloader-ng/issues/84 fixed everything and let me run the program as normal.

Bun-Bun commented 1 week ago

Maybe try this url for the API: https://apiv3.fansly.com/api/v1/messaging/groups?limit=1000&ngsw-bypass=true

I realized that the api by default only returns 20 results, so the group might not have been found because the messages you wanted were older. And by writing a new message, it bumped it up (and replaced one of the 20 results it was returning).

So, the solution should just be to ask for more results. Either in one go by adding ?limit=1000&ngsw-bypass=true

Or if that were to stop working, it might have to make multiple requests, with ?offset=0&ngsw-bypass=true, and increase offset by 20 each request

This plus the other change in downloader.py worked great for me.

jeffwhite6557 commented 5 days ago

I've been following along and trying to create a source code environment on a Win11 PC. The remaining error on installing all is that I cannot seem to get the plyvel-ci wheel to install. Has anyone built a win11 system using the source code and gotten it to work? Little words work best if you know how to help me, :-)