Minor change to requests

This commit is contained in:
Dave Niewinski 2023-12-11 12:09:16 -05:00
parent b8f2cda369
commit c7157e01a3

View File

@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "90ce109a",
"id": "a81468a6",
"metadata": {},
"outputs": [],
"source": [
@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "84df2778",
"id": "290b2ddd",
"metadata": {},
"outputs": [],
"source": [
@ -52,7 +52,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6c36b288",
"id": "dce26c49",
"metadata": {},
"outputs": [],
"source": [
@ -115,7 +115,8 @@
" url, filename = args[0], args[1]\n",
"\n",
" try:\n",
" response = requests.get(url)\n",
" response = requests.get(url, allow_redirects=False)\n",
"\n",
" open(os.path.join(audio_dir, filename), \"wb\").write(response.content)\n",
" return filename, True\n",
" except:\n",
@ -130,7 +131,7 @@
" print(bcolors.FAIL + \"[\" + u'\\u2715' + \"] \" + bcolors.ENDC + result[0])\n",
"\n",
"def main():\n",
" r = requests.get(\"https://theportalwiki.com/wiki/GLaDOS_voice_lines\")\n",
" r = requests.get(\"https://theportalwiki.com/wiki/GLaDOS_voice_lines\", allow_redirects=False)\n",
"\n",
" urls = []\n",
" filenames = []\n",
@ -199,7 +200,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8c883c18",
"id": "50aa0395",
"metadata": {},
"outputs": [],
"source": [
@ -209,7 +210,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "986e916e",
"id": "04d4dd5c",
"metadata": {},
"outputs": [],
"source": [
@ -220,7 +221,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ae039452",
"id": "1d6d4a0d",
"metadata": {},
"outputs": [],
"source": [
@ -232,7 +233,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3717107a",
"id": "1773ddff",
"metadata": {},
"outputs": [],
"source": [
@ -256,7 +257,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "185a6f9b",
"id": "39bd6009",
"metadata": {},
"outputs": [],
"source": [
@ -273,7 +274,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1dd57280",
"id": "f9aa135f",
"metadata": {},
"outputs": [],
"source": [
@ -288,7 +289,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "98da0076",
"id": "f2d1e52d",
"metadata": {},
"outputs": [],
"source": [
@ -314,7 +315,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7ed81322",
"id": "aaefb5e3",
"metadata": {},
"outputs": [],
"source": [
@ -328,7 +329,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "56a8945f",
"id": "120d8ba0",
"metadata": {},
"outputs": [],
"source": [
@ -384,7 +385,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7d6594e8",
"id": "187d85ae",
"metadata": {},
"outputs": [],
"source": [
@ -419,7 +420,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "e36967ad",
"id": "e01801b6",
"metadata": {},
"outputs": [],
"source": [
@ -509,7 +510,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1178d4b7",
"id": "1f792773",
"metadata": {},
"outputs": [],
"source": [
@ -531,7 +532,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "741f10e2",
"id": "b0d15d4d",
"metadata": {},
"outputs": [],
"source": [
@ -577,7 +578,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f75da634",
"id": "bad6e34f",
"metadata": {},
"outputs": [],
"source": [
@ -590,7 +591,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4dad4058",
"id": "f23644bc",
"metadata": {},
"outputs": [],
"source": [
@ -601,7 +602,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5d481c7b",
"id": "63485879",
"metadata": {},
"outputs": [],
"source": [