File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,11 @@ def is_binary():
104104 if not save_images and os .path .isfile (image_file ):
105105 os .remove (image_file )
106106 try : # Fetch and write image.
107- res = requests .get ('https://bing.biturl.top/' , timeout = 10 )
107+
108+ headers = {
109+ "User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
110+ }
111+ res = requests .get ('https://bing.biturl.top/' , timeout = 10 , headers = headers )
108112 res .raise_for_status ()
109113 link = res .json ().get ("url" ) # Get the URL to the image.
110114 if not link : # Exit if the response does not contain the image URL.
@@ -126,4 +130,4 @@ def is_binary():
126130 sizeFile .write (f"{ terminalSizeTuple .columns } ,{ terminalSizeTuple .lines } " )
127131 except subprocess .CalledProcessError as e :
128132 print (f"Error running ascii-image-converter: { e } " )
129- sys .exit (1 )
133+ sys .exit (1 )
You can’t perform that action at this time.
0 commit comments