fileref_upgrade_needed
Hi,
I'm trying to download a few old files from one Telegram channel. I first send the file download request calling GetFile including TLInputDocumentFileLocation,filepartsize and offset. Telegram servers, with this kind of files, allways respond with floodpreventiongexception and I must wait 5000 milisececonds, then I request the file again using the same data and Telegram responds with a fileref_needs_upgrade.
I tried to refetch the document reference calling a GetHistoryAsync but the Location obtained doesn't change.
Does anybody know how to refresh/upgrade the document reference?
Thanks in advance.
Does anybody have a solution of that? I am stucking on it.
Thanks.
I also have the same problem...
Any updates? I have the same issue with getting image message.
Same issue here. Any news?
Yes. I stoped using TLSharp cause it seems dead. Now I'm using TDSharp based on TDLib and it works like a charm.
Please don't hesitate to ask me if you think I can help you in any other way.
Hi @daparici thanks for your answer!
Well, that's disappointing since I've almost completed my application using TLSharp. I was searching for samples of the usage of TDSharp. Do you know where I can find one? (Simple stuff, like auth and get chats)
I'm asking you this here so maybe someone like me can have a chance to change lib before running into my situation :)
Thanks a lot!
Hi Dario,
Attached you will find an uncompleted sample showing how to auth and get the first 100 subscribed channels. TelegramController.txt
Please let me know if you have any problem.
Awesome! Thanks a lot!
Hello Everyone, Is there any update about this issue? Sometimes it works for me, other times it doesn't. Is there any explication?
I also have the same problem...
to download some files/docs library needs to support file references (update schema required), file location param seems to be deprecated: https://core.telegram.org/constructor/fileLocationToBeDeprecated
(update schema required)
Hey @skipme, can you help us update the schema?
to download some files/docs library needs to support file references (update schema required), file location param seems to be deprecated: https://core.telegram.org/constructor/fileLocationToBeDeprecated
Hey skipme. Could you give me a sample examples? My project is almost completed on TLSharp, so I don't want to change to TDLib. Thank you very much!
I've managed to found This repo where there's an updated version with this problem solved.
The new code to get it working is
if (!(message.Media is TLMessageMediaPhoto media) || !(media.Photo is TLPhoto photo))
{
continue;
}
var size = photo.Sizes.OfType<TLPhotoSize>().Last();
var request = new TLInputPhotoFileLocation
{
Id = photo.Id,
FileReference = photo.FileReference,
AccessHash = photo.AccessHash,
ThumbSize = size.Type
};
var buffer = await _client.GetFile(request, 1024 * 512);
I've fixed some namespaces and i'm using those dlls in my project now while i wait for the authors to merge the update TgSharp.TL.zip
On this version i'm having issues while managing the ISessionStore, but the rest is working fine.
I've managed to found This repo where there's an updated version with this problem solved.
The new code to get it working is
if (!(message.Media is TLMessageMediaPhoto media) || !(media.Photo is TLPhoto photo)) { continue; } var size = photo.Sizes.OfType<TLPhotoSize>().Last(); var request = new TLInputPhotoFileLocation { Id = photo.Id, FileReference = photo.FileReference, AccessHash = photo.AccessHash, ThumbSize = size.Type }; var buffer = await _client.GetFile(request, 1024 * 512);I've fixed some namespaces and i'm using those dlls in my project now while i wait for the authors to merge the update TgSharp.TL.zip
On this version i'm having issues while managing the
ISessionStore, but the rest is working fine.
Hey, dariooo512. Thanks very much! By the way, how did you fixed the namespaces? I am fixing it manually, it is really a massive project. Or could you give me the fixed source code, I want to modify something.
I've managed to found This repo where there's an updated version with this problem solved.
The new code to get it working is
if (!(message.Media is TLMessageMediaPhoto media) || !(media.Photo is TLPhoto photo)) { continue; } var size = photo.Sizes.OfType<TLPhotoSize>().Last(); var request = new TLInputPhotoFileLocation { Id = photo.Id, FileReference = photo.FileReference, AccessHash = photo.AccessHash, ThumbSize = size.Type }; var buffer = await _client.GetFile(request, 1024 * 512);I've fixed some namespaces and i'm using those dlls in my project now while i wait for the authors to merge the update TgSharp.TL.zip
On this version i'm having issues while managing the
ISessionStore, but the rest is working fine.
Im does not see TLInputPhotoFileLocation in linked repo.
Im does not see TLInputPhotoFileLocation in linked repo.
https://github.com/aarani/TgSharp/blob/master/src/TgSharp.TL/TL/TLInputPhotoFileLocation.cs
Im does not see TLInputPhotoFileLocation in linked repo.
https://github.com/aarani/TgSharp/blob/master/src/TgSharp.TL/TL/TLInputPhotoFileLocation.cs
Its interesting...repo search founds nothing https://github.com/aarani/TgSharp/search?q=TLInputPhotoFileLocation&unscoped_q=TLInputPhotoFileLocation
Hey, dariooo512. Thanks very much! By the way, how did you fixed the namespaces? I am fixing it manually, it is really a massive project. Or could you give me the fixed source code, I want to modify something.
Which IDE are you using? Consider switching to Rider or installing Resharper extension for VS. They come with advanced solution management (fixing namespaces took one click) TgSharp.Core.zip
Seems like this repo have some serious differences. For example, look into TLChannelDifferenceTooLong - there are no ReadInboxMaxId property.
Yeah, the repo it's an API upgrade from layer 66 to 108 so you probably will encounter breaking changes.
Repo is dirty, very dirty...
Yeah, the repo it's an API upgrade from layer 66 to 108 so you probably will encounter breaking changes.
The changes are...terrible, not breaking. For example - TgSharp.Core.TelegramClient.SendUploadedPhoto has missing caption argument, but TLInputMediaUploadedPhoto have Caption property. And nuget versions of TgSharp/TlSharp have this argument.
Hey, dariooo512. Thanks very much! By the way, how did you fixed the namespaces? I am fixing it manually, it is really a massive project. Or could you give me the fixed source code, I want to modify something.
Which IDE are you using? Consider switching to Rider or installing Resharper extension for VS. They come with advanced solution management (fixing namespaces took one click) TgSharp.Core.zip
I use VS2019 with Resharper extension, but I only know the basic use of the Resharper. How to fix all the Error with one click? Anyway, my problems is solved with the source code you given. Thanks!
Yeah, the repo it's an API upgrade from layer 66 to 108 so you probably will encounter breaking changes.
Some strange thing - message entities are not applied to sended messages. I.e. when i use message copying (take message from one channel and resend it to another channel directly with copying text and Entities property), message formatting is not applied. For example, TLMessageEntityBold is not applied. This entity can be in source message (working nice), but it does not work when use it with same length and offset in new message with the same text. Maybe some flags or message properties is missing in my code? This code works with classic TLSharp.
Yeah, the repo it's an API upgrade from layer 66 to 108 so you probably will encounter breaking changes.
Some strange thing - message entities are not applied to sended messages. I.e. when i use message copying (take message from one channel and resend it to another channel directly with copying text and Entities property), message formatting is not applied. For example, TLMessageEntityBold is not applied. This entity can be in source message (working nice), but it does not work when use it with same length and offset in new message with the same text. Maybe some flags or message properties is missing in my code? This code works with classic TLSharp.
Yes, ComputeFlags method is empty in TLRequestSendMessage. Can it be fixed and recompiled?
FloodException client.ConnectAsync: Flood prevention. Telegram now requires your program to do requests again only after 5 seconds have passed (TimeToWait property). If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.
FILEREF_UPGRADE_NEEDED
I've managed to found This repo where there's an updated version with this problem solved.
The new code to get it working is
if (!(message.Media is TLMessageMediaPhoto media) || !(media.Photo is TLPhoto photo)) { continue; } var size = photo.Sizes.OfType<TLPhotoSize>().Last(); var request = new TLInputPhotoFileLocation { Id = photo.Id, FileReference = photo.FileReference, AccessHash = photo.AccessHash, ThumbSize = size.Type }; var buffer = await _client.GetFile(request, 1024 * 512);I've fixed some namespaces and i'm using those dlls in my project now while i wait for the authors to merge the update TgSharp.TL.zip
On this version i'm having issues while managing the
ISessionStore, but the rest is working fine.
please discard a working example, with your example
Any update, im stucking with this too, please help
Yes. I stoped using TLSharp cause it seems dead. Now I'm using TDSharp based on TDLib and it works like a charm.
Please don't hesitate to ask me if you think I can help you in any other way.
Can you please guide me to use TDSharp in webforms