The content of the file in question is included in the returned data. You are getting the full GitHub view of that file, not just the contents.

If you want to download just the file, you need to use the Raw link at the top of the page, which will be (for your example):

https://raw.githubusercontent.com/someguy/brilliant/master/somefile.txt

Note the change in domain name, and the blob/ part of the path is gone.

To demonstrate this with the requests GitHub repository itself:

>>> import requests
>>> r = requests.get('https://github.com/kennethreitz/requests/blob/master/README.rst')
>>> 'Requests:' in r.text
True
>>> r.headers['Content-Type']
'text/html; charset=utf-8'
>>> r = requests.get('https://raw.githubusercontent.com/kennethreitz/requests/master/README.rst')
>>> 'Requests:' in r.text
True
>>> r.headers['Content-Type']
'text/plain; charset=utf-8'
>>> print r.text
Requests: HTTP for Humans
=========================


.. image:: https://travis-ci.org/kennethreitz/requests.png?branch=master
[... etc. ...]
Answer from Martijn Pieters on Stack Overflow
🌐
GitHub
github.com › Logan1x › Python-Scripts
GitHub - Logan1x/Python-Scripts: Collection of Various Python Script's.💻
More features will be added in the future iterations of the project. a simple video downloader using youtube-dl Library, a starter script for making use of youtube-dl. ... Can be downloaded using pip on windows and respective package managers on different operating systems. ffmpeg in order to convert the downloaded files to the right format · Clone this repo and run python vid.py script!
Starred by 330 users
Forked by 148 users
Languages   Python 90.0% | Jupyter Notebook 5.7% | PowerShell 4.3% | Python 90.0% | Jupyter Notebook 5.7% | PowerShell 4.3%
🌐
Agisoft Support
agisoft.freshdesk.com › support › solutions › articles › 31000168292-how-to-download-script-from-github-
How to download script from GitHub? : Helpdesk Portal
February 14, 2024 - https://github.com/agisoft-llc/metashape-scripts/tree/master/src/samples · Open general_workflow.py script (click on the *.py file) as shown in the animation below: ... Then specify the path to the folder where the script should be saved and ...
🌐
GitHub
github.com › Nordgaren › Github-Folder-Downloader
GitHub - Nordgaren/Github-Folder-Downloader: a python script for downloading a folder from github, instead of the entire repo. · GitHub
a python script for downloading a folder from github, instead of the entire repo. - Nordgaren/Github-Folder-Downloader
Author   Nordgaren
🌐
GitHub
gist.github.com › junhe › 806c57ce629e1d7035a1
This Python script downloads private github raw files. · GitHub
This Python script downloads private github raw files. - download_github_private_file.py
🌐
Quora
quora.com › How-do-I-download-a-Python-file-from-GitHub
How to download a Python file from GitHub - Quora
Answer (1 of 9): This applies more to source code in general than specifically to python code. On the project's GitHub webpage, on the top right, there is usually a green button labelled ‘Clone or Download’. Click on it, click on ‘Download zip’ and the download process should begin.
🌐
GitHub
github.com › topics › python-scripts
python-scripts · GitHub Topics · GitHub
javascript python c java html php cpp python-script python3 python-scripts hacktoberfest hacktoberfest-accepted hacktober-fest hacktober-fest-contributions hacktoberfest2022 adarshaddee adarsh-addee mr-idealhat mridealhat codarsh ... Website-downloader is a powerful and versatile Python script designed to download entire websites along with all their assets.
Find elsewhere
🌐
GitHub
gist.github.com › 3761913
A sample python script for downloading the current non-redundant lists from the RNA 3D Hub · GitHub
Clone this repository at <script src="https://gist.github.com/AntonPetrov/3761913.js"></script> Save AntonPetrov/3761913 to your computer and use it in GitHub Desktop. Download ZIP · A sample python script for downloading the current non-redundant lists from the RNA 3D Hub ·
🌐
GitHub
github.com › topics › python-script
python-script · GitHub Topics · GitHub
Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!
🌐
GitHub
gist.github.com › oculushut › 193a7c2b6002d808a791
Example for using Python to download file · GitHub
Clone this repository at <script src="https://gist.github.com/oculushut/193a7c2b6002d808a791.js"></script> Save oculushut/193a7c2b6002d808a791 to your computer and use it in GitHub Desktop. Download ZIP · Example for using Python to download file ·
🌐
Fabrizio Musacchio
fabriziomusacchio.com › home › blog
How to install and run Python code from GitHub - Fabrizio Musacchio
April 29, 2026 - It can also simplify workflows involving authentication, private repositories, forks, issues, and pull requests. For beginners who only want to download and run Python code, GitHub Desktop or the normal git clone command are usually sufficient.
🌐
GitHub
gist.github.com › 2810241
python download file · GitHub
Clone this repository at <script src="https://gist.github.com/mikezhuyuan/2810241.js"></script> Save mikezhuyuan/2810241 to your computer and use it in GitHub Desktop. Download ZIP · python download file · Raw · download file.py · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
🌐
Python.org
discuss.python.org › python help
Download several files from github - Python Help - Discussions on Python.org
June 7, 2021 - Dear Python community, I am brand new to Python. I would like to download all the files available on this Github link: professions-foi-candidats/documents/LG17/1 at master · regardscitoyens/professions-foi-candidats · …
🌐
Quora
quora.com › How-do-I-run-a-Python-script-that-I-downloaded-from-GitHub
How to run a Python script that I downloaded from GitHub - Quora
Answer (1 of 3): If you are on a windows or linux machine you can just navigate to the directory where the file is, on your machine ,in a terminal or cmd in windows and execute “python ” (without braces) As simple as that 😉🙂
🌐
GitHub
github.com › python › docsbuild-scripts
GitHub - python/docsbuild-scripts: scripts for building documentation on docs.python.org · GitHub
This repository contains scripts for automatically building the Python documentation on docs.python.org.
Starred by 81 users
Forked by 66 users
Languages   Python 83.8% | JavaScript 8.8% | HTML 7.4%