webpeel 0.21.75 → 0.21.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5987,24 +5987,25 @@ async function googleFlightsExtractor(_html, url) {
5987
5987
  return null;
5988
5988
  unique.sort((a, b) => a.price - b.price);
5989
5989
  // Helper: get airline booking URL
5990
- function getAirlineBookingUrl(airline, from, to) {
5991
- const fromLower = from.toLowerCase();
5992
- const toLower = to.toLowerCase();
5990
+ function getAirlineBookingUrl(airline, from, to, dateStr) {
5991
+ const fromUp = from.toUpperCase();
5992
+ const toUp = to.toUpperCase();
5993
+ // Airline homepages — direct booking pages (deep links don't work without session/cookies)
5993
5994
  const urlMap = {
5994
- 'United': `https://www.united.com/en-us/flights-from-${fromLower}-to-${toLower}`,
5995
- 'Delta': `https://www.delta.com/flight-search/search`,
5996
- 'JetBlue': `https://www.jetblue.com/booking/flights`,
5997
- 'American': `https://www.aa.com/booking/find-flights`,
5998
- 'Spirit': `https://www.spirit.com/book/flights`,
5999
- 'Frontier': `https://www.flyfrontier.com/booking/`,
6000
- 'Southwest': `https://www.southwest.com/air/booking/`,
6001
- 'Breeze': `https://www.flybreeze.com/home`,
6002
- 'Alaska': `https://www.alaskaair.com/booking/flights`,
6003
- 'Hawaiian': `https://www.hawaiianairlines.com/book-a-trip`,
6004
- 'Sun Country': `https://www.suncountry.com/booking/search`,
6005
- 'Avelo': `https://www.aveloair.com/book`,
5995
+ 'United': `https://www.united.com`,
5996
+ 'Delta': `https://www.delta.com`,
5997
+ 'JetBlue': `https://www.jetblue.com`,
5998
+ 'American': `https://www.aa.com`,
5999
+ 'Spirit': `https://www.spirit.com`,
6000
+ 'Frontier': `https://www.flyfrontier.com`,
6001
+ 'Southwest': `https://www.southwest.com`,
6002
+ 'Breeze': `https://www.flybreeze.com`,
6003
+ 'Alaska': `https://www.alaskaair.com`,
6004
+ 'Hawaiian': `https://www.hawaiianairlines.com`,
6005
+ 'Sun Country': `https://www.suncountry.com`,
6006
+ 'Avelo': `https://www.aveloair.com`,
6006
6007
  };
6007
- return urlMap[airline] || `https://www.google.com/search?q=${encodeURIComponent(`${airline} flights ${from} to ${to}`)}`;
6008
+ return urlMap[airline] || `https://www.google.com/travel/flights?q=${encodeURIComponent(`${airline} flights ${fromUp} to ${toUp} ${dateStr}`)}`;
6008
6009
  }
6009
6010
  // Parse route from URL
6010
6011
  const u = new URL(url);
@@ -6018,17 +6019,18 @@ async function googleFlightsExtractor(_html, url) {
6018
6019
  ];
6019
6020
  for (let idx = 0; idx < unique.length; idx++) {
6020
6021
  const f = unique[idx];
6021
- const bookingUrl = getAirlineBookingUrl(f.airline, f.fromAirport, f.toAirport);
6022
+ const bookingUrl = getAirlineBookingUrl(f.airline, f.fromAirport, f.toAirport, f.departDate);
6022
6023
  md.push(`## ${idx + 1}. ${f.airline} — ${f.priceStr}`);
6023
6024
  md.push(`🕐 Depart **${f.departTime}** → Arrive **${f.arriveTime}**${f.departDate ? ` · ${f.departDate}` : ''}`);
6024
6025
  md.push(`🛫 ${f.fromAirport} → ${f.toAirport} · ${f.duration} · ${f.stops}`);
6025
6026
  if (f.bags)
6026
6027
  md.push(`🧳 ${f.bags}`);
6027
- md.push(`🔗 [Book on ${f.airline}](${bookingUrl})`);
6028
+ md.push(`🔍 [See price on Google Flights](${url})`);
6029
+ md.push(`🛒 [Book on ${f.airline}](${bookingUrl})`);
6028
6030
  md.push('');
6029
6031
  }
6030
6032
  md.push('---');
6031
- md.push(`📌 *Prices change frequently. [View live prices on Google Flights](${url})*`);
6033
+ md.push(`📌 *All prices verified via [Google Flights](${url}). Click "See price" to confirm, then book directly with the airline.*`);
6032
6034
  return {
6033
6035
  domain: 'google.com/travel/flights',
6034
6036
  type: 'flights',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpeel",
3
- "version": "0.21.75",
3
+ "version": "0.21.77",
4
4
  "description": "Fast web fetcher for AI agents - stealth mode, crawl mode, page actions, structured extraction, PDF parsing, smart escalation from simple HTTP to headless browser",
5
5
  "author": "Jake Liu",
6
6
  "license": "AGPL-3.0-only",