webpeel 0.21.76 → 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.
@@ -5988,36 +5988,24 @@ async function googleFlightsExtractor(_html, url) {
5988
5988
  unique.sort((a, b) => a.price - b.price);
5989
5989
  // Helper: get airline booking URL
5990
5990
  function getAirlineBookingUrl(airline, from, to, dateStr) {
5991
- // Parse date from "Sat, Apr 4" → "2026-04-04" or "04/04/2026" etc.
5992
- const months = { Jan: '01', Feb: '02', Mar: '03', Apr: '04', May: '05', Jun: '06', Jul: '07', Aug: '08', Sep: '09', Oct: '10', Nov: '11', Dec: '12' };
5993
- let isoDate = '';
5994
- let mmddDate = '';
5995
- const dm = dateStr.match(/(\w{3})\s+(\d{1,2})/);
5996
- if (dm) {
5997
- const mon = months[dm[1]] || '01';
5998
- const day = dm[2].padStart(2, '0');
5999
- const year = new Date().getFullYear(); // current year
6000
- isoDate = `${year}-${mon}-${day}`;
6001
- mmddDate = `${mon}/${day}/${year}`;
6002
- }
6003
5991
  const fromUp = from.toUpperCase();
6004
5992
  const toUp = to.toUpperCase();
6005
- // Deep links with pre-filled origin, destination, date, 1 passenger
5993
+ // Airline homepages direct booking pages (deep links don't work without session/cookies)
6006
5994
  const urlMap = {
6007
- 'United': `https://www.united.com/ual/en/us/flight-search/book-a-flight/results/rev?f=${fromUp}&t=${toUp}&d=${isoDate}&tt=1&at=1&sc=7&px=1&taxng=1&newHP=True&clm=7&st=bestmatches&tqp=A`,
6008
- 'Delta': `https://www.delta.com/flight-search/book-a-flight?departure=${fromUp}&arrival=${toUp}&departureDate=${mmddDate}&paxCount=1&tripType=ONE_WAY`,
6009
- 'JetBlue': `https://www.jetblue.com/booking/flights?from=${fromUp}&to=${toUp}&depart=${isoDate}&is498=true&is498=${true}&pax=1`,
6010
- 'American': `https://www.aa.com/booking/find-flights?origin=${fromUp}&destination=${toUp}&departureDate=${isoDate}&tripType=OneWay&pax=1`,
6011
- 'Spirit': `https://www.spirit.com/book/flights?origin=${fromUp}&destination=${toUp}&departureDate=${isoDate}&adults=1&tripType=oneWay`,
6012
- 'Frontier': `https://www.flyfrontier.com/booking/flights?origin=${fromUp}&destination=${toUp}&date=${isoDate}&adults=1`,
6013
- 'Southwest': `https://www.southwest.com/air/booking/select.html?originationAirportCode=${fromUp}&destinationAirportCode=${toUp}&departureDate=${isoDate}&adultPassengersCount=1&tripType=oneway`,
6014
- 'Breeze': `https://www.flybreeze.com/home?from=${fromUp}&to=${toUp}&depart=${isoDate}&pax=1`,
6015
- 'Alaska': `https://www.alaskaair.com/shopping/flights?A=${fromUp}&B=${toUp}&DT=${isoDate}&FT=ow&C=1`,
6016
- 'Hawaiian': `https://www.hawaiianairlines.com/book/results?origin=${fromUp}&destination=${toUp}&departDate=${isoDate}&adults=1&tripType=ow`,
6017
- 'Sun Country': `https://www.suncountry.com/booking/search?from=${fromUp}&to=${toUp}&depart=${isoDate}&passengers=1`,
6018
- 'Avelo': `https://www.aveloair.com/book?from=${fromUp}&to=${toUp}&depart=${isoDate}`,
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`,
6019
6007
  };
6020
- return urlMap[airline] || `https://www.google.com/travel/flights?q=${encodeURIComponent(`${airline} flights ${from} to ${to} ${dateStr}`)}`;
6008
+ return urlMap[airline] || `https://www.google.com/travel/flights?q=${encodeURIComponent(`${airline} flights ${fromUp} to ${toUp} ${dateStr}`)}`;
6021
6009
  }
6022
6010
  // Parse route from URL
6023
6011
  const u = new URL(url);
@@ -6037,11 +6025,12 @@ async function googleFlightsExtractor(_html, url) {
6037
6025
  md.push(`🛫 ${f.fromAirport} → ${f.toAirport} · ${f.duration} · ${f.stops}`);
6038
6026
  if (f.bags)
6039
6027
  md.push(`🧳 ${f.bags}`);
6040
- md.push(`🔗 [Book on ${f.airline}](${bookingUrl})`);
6028
+ md.push(`🔍 [See price on Google Flights](${url})`);
6029
+ md.push(`🛒 [Book on ${f.airline}](${bookingUrl})`);
6041
6030
  md.push('');
6042
6031
  }
6043
6032
  md.push('---');
6044
- 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.*`);
6045
6034
  return {
6046
6035
  domain: 'google.com/travel/flights',
6047
6036
  type: 'flights',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpeel",
3
- "version": "0.21.76",
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",