Telegram API file download path return 404 - telegram-bot

As a topicstarted before me, got issues with downloading a file via telegram bot.
Using python + pyTelegramBotAPI(telebot).
Sequence of actions:
Got update about file received and extracting file_id like: BQACAgIAAxkBAANqXxfz1kGAatLmqZyhTndjmejo0LsAAq4HAAKCScFIxj2AovwylDMaBA.
Using telebot.get_file_url to get valid link to file.
Got something like this:
https://api.telegram.org/file/bot{HERE_IS_MY_BOT_TOKEN}/documents/file_22.csv
Performing telebot.download using this URL is failed, cause of response:
[{"ok":false,"error_code":404,"description":"Not Found"}].
Performing get request using Requests lib via same url return the same error.
But opening the same link using browser is working well and downloading the file.
Dear stackoverflow, need your help to figure out how to avoid this. ;3

Actually, hardcoding "http" over "https" in download link resolved the problem for me.

Related

Postman file uploading: the file path became missing when I close the request tab

I'm uploading files through PUT request and put my file as a Binary into the Body request:
https://i.stack.imgur.com/GXuMa.png
The problem is that the file path became missing once I close the request tab and I try to run through Runner, so this makes it impossible to run it through Runner.
Here's the screencast of what I mean: http://take.ms/ptLCT
Is there a way to save the file path inside the request body?
Thanks in advance for any suggestions!
This seems to be a long standing issue with postman that is still not resolved. It seems you can get around it by using newman instead (postman commandline runner). Alternatively check out Insomnia REST client instead, which seems to support this.

Securing GitLab Pages with Let's Encrypt gets 404

I am following this tutorial https://about.gitlab.com/2016/04/11/tutorial-securing-your-gitlab-pages-with-tls-and-letsencrypt/
Next step instructions are:
Make sure your web server displays the following content at
http://YOURDOMAIN.org/.well-known/acme-challenge/5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM
before continuing:
5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM.ewlbSYgvIxVOqiP1lD2zeDKWBGEZMRfO_4kJyLRP_4U
#
# output omitted
#
Press ENTER to continue
According to the tutorial, it's using Jekyll, but I don't use a static html generator like jekyll. The files are all static html. I created the exact path under root folder: /.well-known/acme-challenge/PukY0bbiH3nRfciQ4IzwTDIXFn4G5sZ5I-LkMz3-KHE.html
But after the piplines jobs are done, I am still getting 404. What's the problem here?
I had problem same yesterday and I found the solution, I hope it is not too late to share with you. According to this tutorial here, the "well-known" folder should be under the "public" folder.
And the letsencrypt need to access a .html file in the following path using the browser.
http://YOURDOMAIN.org/.well-known/acme-challenge/5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM
To do this, you must create the "index.html" file in the path below inside your gitlab repository.
public/.well-known/acme-challenge/5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM/index.html
In the "index.html" file you should put only the following sentence:
5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM.ewlbSYgvIxVOqiP1lD2zeDKWBGEZMRfO_4kJyLRP_4U
important: do not put any html tag, just the plain text above.
Then just continue following the tutorial. Good luck.

CKAN resource file upload by api?

How do I upload file in to resource (either create or update)in CKAN using apis.
I followed the documentation it seems working but getting an error at datapusher page.
Click here for Image of Error
this error indicates a time-out when the datapusher service tries to download the resource from CKAN.
#florianm is dead right here.
Another thing to check is the resource url. The exception suggests you've forgotten to put http:// on the front of the url, or something similar.
Also note that you can upload files directly to CKAN if they are not already on-line somewhere else.
#Vithal this error indicates a time-out when the datapusher service tries to download the resource from CKAN.
Some pointers:
What do your CKAN and datapusher error logs say?
How big is your resource file?
Does this error occur when you upload a tiny CSV file?
Does this error occur when you upload your original resource file to
demo.ckan.org?

CKFinder Upload Permissions Issue

Afternoon,
I have been working with CKEditor and CKFinder for the last few days and it all worked locally. Once I put it live in all aspects it worked except when attempting to upload a .pdf file to the server via the Link -> Upload tab.
The error that I receive is "The requested resource type is not valid". I have set the folders that it is uploading to, to 777 and I have made sure that the Resource type of Files also allows for the extensions of .pdf in config.php of CKFinder.
This error is stopping me from completion of my project and I really am out of things to try any ideas/ work arounds would be brilliant.
One possible solution was to use KCFinder which I was told would work but my boss said that was not an option unfortunately.
The problem seems to have been an out dated version of CKFinder and I fiddled with the config file and made sure that the $baseUrl and $baseDir followed the rules in the comments. Prior to that I think my $baseUrl did not have the '/' at the beginning of it and now does. The problem lies in the config.php file in CKFinder for anyone else that has the problem.
If the message is "the resource type is not valid" then it's not a permissions issue, but instead that you have renamed the resource types and so it doesn't initialize properly.
If you already have a license to CKFinder you should post this kind of questions at the forums or through the support channel.

File not found - Google Safe Browsing Lookup API

I try to make a browser call to
https://sb-ssl.google.com/safebrowsing/api/lookup?
With and without the API key, etc, but each time and no matter what I do, I get:
File not found
Firefox can't find the file at https://sb-ssl.google.com/safebrowsing/api/lookup?.
Check the file name for capitalization or other typing errors.
Check to see if the file was moved, renamed or deleted.
Any ideas what might be the problem?
The URL you are using is AFAIk from the Google Safebrowsing API V 1 which used to support GET requests and is now deprecated (and will be taken offline by December 1st) - I strongly recommend switching to V2 of the API which from what I gather only supports requests via POST.
EDIT:
SORRY - I overread the "Lookup" part...
I just checked the URL you gave... From Firefox (latest version) I can confirm what you describe... OTOH when I try it via IE the result is different - it comes back with HTTP 403 which I assume is due to the fact that I don't have a valid key...
I can only conclude that Firefox does something Google won't accept - it can be related to User agent or whatever... have you tried this with a simple wget or some http client component/class ?