Thiloid commited on
Commit
3b54a33
·
verified ·
1 Parent(s): 6affa62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -171,17 +171,25 @@ def is_single_word_question(question):
171
  return 1
172
  return 0
173
  def get_value_after_question_mark(url):
174
- url=str(url)
175
  # Find the position of the question mark
176
  question_mark_index = url.find('?')
177
 
178
  # Extract the part after the question mark
179
  if question_mark_index != -1:
180
- value_after_question_mark = url[question_mark_index + 1:].split('=')[0]
181
- else:
182
- value_after_question_mark = ""
 
 
 
 
 
 
 
 
183
 
184
- return value_after_question_mark
185
  def extract_ip_and_device(headers_obj):
186
  ip_address = None
187
  device_info = None
 
171
  return 1
172
  return 0
173
  def get_value_after_question_mark(url):
174
+ url = str(url)
175
  # Find the position of the question mark
176
  question_mark_index = url.find('?')
177
 
178
  # Extract the part after the question mark
179
  if question_mark_index != -1:
180
+ # Get the query string part after the '?'
181
+ query_string = url[question_mark_index + 1:]
182
+
183
+ # Split the query string into key-value pairs
184
+ key_value_pairs = query_string.split('&')
185
+
186
+ # Loop through key-value pairs and extract the value
187
+ for pair in key_value_pairs:
188
+ key, value = pair.split('=')
189
+ if key == 'var1': # Check for the specific variable
190
+ return value
191
 
192
+ return ""
193
  def extract_ip_and_device(headers_obj):
194
  ip_address = None
195
  device_info = None