How to get api id and hash for telegram from .session file? - api

I use a software for scrapping telegram members from groups. The software requires a phone number, api id and hash. I have .session file, but I can't add this file into software, it doesn't work like that. I need to write api id and hash manually.
I use MacOS. Is it possible to extract datas from this file? Or to open this session file in telegram app, to receive a code?

Related

Are api_id and api_hash secrets?

I am very confused about this topic, I am creating a program and to extract media from a telegram channel I wanted to use
the Telethon api, are therefore necessary api_id and api_hash, if then I wanted to distribute this software is safe to do this considering that there are these two data?
Yes, they are personal and secret, you should distribute the software without your API ID or hash. Every user can get its own values from https://my.telegram.org and set it in a config file or similar. Then you can load it from it.

Is there any way to transfer Telegram file IDs between different bots?

Many different media types on Telegram have a file_id and file_unique_id property, such as Stickers, Audio, and Document.
The file_id property is unique to each Telegram bot, so one Telegram bot will not report the same file_id as another Telegram bot will, even if it's the same piece of media.
I want to have two Telegram bots communicate with each other, but they are currently unable to do so because the file_id property is meaningless when one bot tries to talk to the other.
The file_unique_id property is consistent between the bots, but it does not seem like you can do much of anything with that identifier.
Is there any way to pass a reference to a file stored on Telegram's servers from one bot to another, without having to re-upload the file on both bots?
Bot can't interact with each other. But there's a workaround,
we can use channels as a medium (with only BotAPI)
Steps,
Add two bots as admin in channel
Broadcast the messages from Bot A to channel
Now, the Bot B will get these as channel posts and your new fileid
for the same file which will be unique for Bot B (obviously)
You have officially transferred all fileid to Bot B
There aren't any official methods to share fileIds between bots. In fact, you can't even get 2 bots talk to each other, also you won't get bot updates in groups. So bot to bot communication is not possible at all at this moment.
But what you can do is to use Mtproto api and sign-in to telegram as a normal user (with phone number). And follow these steps using the logged in account:
Start both of your bots.
Forward messages you receive from bot 1 to bot 2.
This way you'll be able to access any files in bot 1 in bot 2.
You can use Telethon to write a script that does the job for you, listening to updates coming from bot 1 & forwarding them to bot 2.
Also using normal bot api you should forward received messages to your logged-in account.
The only way is to use a shared channel. Both bots have admin access. However, you may encounter error 429 while transferring the file.
The solution is to send the files to the channel at longer intervals.

Dropbox API finding new/changed files

I'm trying to setup a webhook from dropbox to notify my server whenever a new file is uploaded.
There are 1000's of files being shared but < 100 everyday and I only want to find the new files of a certain type that have been added or modified since the last check.
The webhook sends the userid when the file is added but doesn't indicate a file name.
Is there anyway using the list_folder api, or using another api to find out what file has been changed since a certain date?
Dropbox webhooks only tell you that something changed, but not what specifically changed.
You can use these in conjunction with /2/files/list_folder[/continue] to see what changed. The webhooks documentation and the Content Access Guide have more information about this.
In short, the basic flow would be like this:
The user connects the app to their account, and the app saves the resulting access token for that user.
The app gets the current state of the account using /2/files/list_folder[/continue], and stores the latest returned cursor.
The user makes changes in their account.
Dropbox notifies the app of changes in the user's account using a webhook notification.
The app receives the webhook notification and looks up the corresponding access token and cursor for the specified user.
The app calls /2/files/list_folder/continue using the cursor to retrieve only what changed since it last called, and again stores the latest returned cursor.
(Repeat)

How to obtain the existing Google Analytic clientId on OS X and/or Windows for use with Google Measurement Protocol

We are extending our analytic coverage to include actions on our Desktop apps for Windows and Mac OSX.
The Google Measurement Protocol is simple enough to use:
https://developers.google.com/analytics/devguides/collection/protocol/v1/
Is there a way that we can extract the existing Google client-id, that is, the id generated by Google and generally stored in a cookie on the computer that uniquely and anonymously identifies the client?
For clarity - you would typically use Javascript to extract it in a web-page as follows;
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id?hl=en#getting_the_client_id_from_the_cookie
How do you do the same using a language such as Swift or Objective-C on OS X, or MFC/C++ on Windows.
The client id is generated by the Javascript tracking code (or the SDK respectively). So if you use the measurement protocol there is no pre-existing client id that you could extract.
The good news is that you can generate your own. Google Analytics isn't critical w/r/t what it accepts as client id, any string will do - however to serve it's intended purpose it must be unique, so a UUID is recommended.
The best way to do this would be to use the User ID feature of Google Analytics. This feature lets you send your own ID instead of using the randomly generated Client ID (that is stored in a cookie).
So if the user visits your website and identifies themselves (e.g. logs in), then you would sent their "customer ID" using the User ID feature. Then, if that user goes on to install your desktop application and also identifies themselves (by logging in again), then you would use the measurement protocol to send the same "customer ID". You would do this by using the &uid measurement protocol parameter. Google Analytics will then identify this as the same user an you will basically get x-device behaviour in GA. This will allow you to figure out that campaign A drove a website visit as well as an eventual desktop app download.

Obtain Adobe DPS folio list

Is there any way to get folio list from adobe DPS publishing server to machine with implemented direct entitlement?
Only method which i know right now is to put that information to my database manually.
You can get the folio from the fulfilment server the same way the viewer application does.
Call the URL
http://edge.adobe-dcfs.com/ddp/issueServer/issues?accountId=xxxx&targetDimension=all
using your accountId in the place of xxxx
To get the accountId you need to call this URL http://lighthouse.adobe.com/dps/entitlement and enter your account's login and password there. If you don't want to do that you can open the .ipa file of you iPad app and get the accountId from within the file LibraryConfig.plist. The value is at serviceOptions->fulfillment->loginOptions->accountId.